• I have WordPress e commerce site with responsive comparison theme , Now I have setup crawler which scrapes the price from various pages . This crawler gives me an api (url) which i want to post instead of numeric values. Now how do I program it to get the data from url and if the data from url is not available then to use another variable which would contain a fallback price. I want to use this api because the crawler runs every 15 minutes and could help me in getting live data. I would be importing these urls through csv import tool.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I don’t get what you are asking? If you want something coded, then please try one of the following sites:

    This topic has now been closed as per the Forum Rules

    Thread Starter anshul1994

    (@anshul1994)

    I want to post url link in price option . Is there any way to do it?
    (Contents of url in price)

    Thread Starter anshul1994

    (@anshul1994)

    I modified class_core.php file to this:
    Price Display
    ========================================================================== */
    function curl_download($Url){
    // is cURL installed yet?
    if (!function_exists(‘curl_init’)){
    die(‘Sorry cURL is not installed!’);
    }
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $Url);
    curl_setopt($ch, CURLOPT_REFERER, “http://www.example.org/yay.htm”);
    curl_setopt($ch, CURLOPT_USERAGENT, “MozillaXYZ/1.0”);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    $output = curl_exec($ch);
    curl_close($ch);
    return $output;
    }
    $url_for_value = “https://www.xyz.com/dddddd/ddddd”;
    // remember to add http colon and two slashes in front of url…
    // stackoverflow tools won’t let me do that here…
    $val = curl_download($url_for_value);

    function PRICE($val){

    if(!is_numeric($val) && defined(‘WLT_JOBS’) ){
    // if not numeric, e.g. $100 , strip off non-numeric characters.
    preg_match_all(‘/([\d]+)/’, $val, $match);
    // Do we have a valid number now?
    if (!is_numeric($match[0]){
    // perform other tests on return info from the CURL function?
    return $val;
    }
    $val = $match[0];
    }

    but still it doesnt seem to work

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to modify files in wordpress?’ is closed to new replies.