James Bachini

get

  • Option to Disable Adsense Ads

    Option to Disable Adsense Ads

    In some cases it is beneficial to provide a link or option for visitors to a site not to see the adsense ads the first time they visit a page. Ads can sometimes be viewed negatively and for the first visit or under certain circumstances it is best to temporarily disable them. Here is the…

  • Passing Through Landing Page Variables

    This was inspired by another post which is well worth a read at: http://affplaybook.com/blog/affiliate-marketing/the-ultimate-guide-to-landing-page-tricks/ So many traffic sources provide you with tags such as {keyword} {countrycode} {device} etc. You can add these variables to your url so it would look something like: http://www.myserver.com/landingpage.htm?kw={keyword}&device={device} Then in the code to your landing page you can access these…

  • Two php functions for scraping content and extracting links

    ////// Grab webpage ////// function webFetcher($url) { $crawl = curl_init(); curl_setopt ($crawl, CURLOPT_URL, $url); curl_setopt($crawl, CURLOPT_RETURNTRANSFER, 1); $resulting = $resulting.curl_exec($crawl); curl_close($crawl); return $result = $resulting; } //////////////////////////////// //// extract links //// function extract_links($text) { preg_match_all(‘/<\s*a[^<>]*?href=[\’”]?([^\s<>\’”]*)[\’”]?[^<>]*>(.*?)<\/a>/si’, $text, $match_array, PREG_SET_ORDER); $return = array() ; foreach ($match_array as $serp) { $full_anchor = $serp[0]; $href = $serp[1]; $anchortext =…