Tagged: get

0

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 code so that you can just add ?noads=1 to the end of your url and...

Passing Through Landing Page Variables 0

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 variables. I’ll put examples in PHP and Javascript but any web based language should provide...

Two php functions for scraping content and extracting links 0

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 = $serp[2]; if ( (preg_match(“/http:/i”,$href)) && (!preg_match(“/cache/i”,$href)) && (!preg_match(“/google.com/i”,$href)) && (!preg_match(“/youtube.com/i”,$href)) && (!preg_match(“/wikipedia.org/i”,$href)) && ($href[0]!= ‘/’)...