Shane Jones

Co-Founder of Peadig, Freelance Developer and Consultant to Agencies in the North West

Archive for the ‘PHP’ Category

Determining http or https for files references

If you have a https site and pull http content you can and probably will get a warning. http content on a https site will also yield a warning Add this in place of http/https to solve all problems. [code] <?=(isset($_SERVER[‘HTTPS’])?"https://":"http://")?> [/code]


Pulling recent hashtags from twitter

This code pulls a json of a hashtag search from twitter. It runs some functions to add to a database. (functions not included.) [php] global $total, $hashtag; $hashtag = ‘#somehashtag'; $total = 0; function getTweets($hash_tag, $page) { global $total, $hashtag; $url = ‘http://search.twitter.com/search.json?q=’.urlencode($hash_tag).’&'; $url .= ‘page=’.$page; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $json = curl_exec($ch);…