开发者

How to get content from gowalla url?

How to get content from gowalla url in php or javascript? Like this: http://api.gowalla.com开发者_JAVA技巧/spots?lat=30.2697&lng=-97.7494&radius=50


Try using these functions:

  1. Using cURL

    function get_data($url) { $ch = curl_init(); $timeout = 5; curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); $data = curl_exec($ch); curl_close($ch); return $data; }

    $returned_content = get_data('http://api.gowalla.com/spots?lat=30.2697&lng=-97.7494&radius=50');

  2. Using file_get_contents

    $url = "http://api.gowalla.com/spots?lat=30.2697&lng=-97.7494&radius=50"; $str = file_get_contents($url);

You can also help with this URL: http://nadeausoftware.com/articles/2007/06/php_tip_how_get_web_page_using_curl

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜