This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function get($url){ | |
| $ch = curl_init(); | |
| curl_setopt($ch, CURLOPT_URL, $url); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
| $output = curl_exec($ch); | |
| curl_close($ch); | |
| return $output; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function get($url){ | |
| $ch = curl_init(); | |
| curl_setopt($ch, CURLOPT_URL, $url); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
| $output = curl_exec($ch); | |
| curl_close($ch); | |
| return $output; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| new Request.Twitter('phploveme',{ | |
| data: {count: 5}, | |
| onSuccess: function(data){ | |
| data.each(function(data){ | |
| new Element('div',{ | |
| class: 'tweet', | |
| html: data.text | |
| }).inject('tweets','bottom'); | |
| }) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Request.Twitter = new Class({ | |
| Extends: Request.JSONP, | |
| options: { | |
| url: 'http://twitter.com/statuses/user_timeline/{username}.json', | |
| data: { | |
| count: 5 | |
| }, | |
| linkify: true | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Request.Weather = new Class({ | |
| Extends: Request.JSONP, | |
| options: { | |
| url: 'http://query.yahooapis.com/v1/public/yql?q=use%20%22http%3A%2F%2Fthinkphp.ro%2Fapps%2FYQL%2Fweather-forecast%2Fweather.woeid.xml%22%20as%20weather%3B%20select%20*%20from%20weather%20where%20location%3D%22{term}%22%20and%20unit%3D%22c%22%3B', | |
| data: { | |
| format: 'json' | |
| } | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Request.Weather = new Class({ | |
| Extends: Request.JSONP, | |
| options: { | |
| url: 'http://query.yahooapis.com/v1/public/yql?q=use%20%22http%3A%2F%2Fthinkphp.ro%2Fapps%2FYQL%2Fweather-forecast%2Fweather.woeid.xml%22%20as%20weather%3B%20select%20*%20from%20weather%20where%20location%3D%22{term}%22%20and%20unit%3D%22{unit}%22%3B', | |
| data: { | |
| format: 'json' | |
| } | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.addEvent('domready',function(){ | |
| new Request.Weather('bucharest','c',{ | |
| onSuccess: function(o){ | |
| var title = '<p style="color: blue"><strong>'+o.query.results.weather.rss.channel.item.title+'</strong></p>', | |
| description = o.query.results.weather.rss.channel.item.description; | |
| $('weatherbadge').set('html',title+description); | |
| } | |
| }).send(); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Request.Flickr = new Class({ | |
| Extends: Request.JSONP, | |
| options: { | |
| url: "http://query.yahooapis.com/v1/public/yql?q=use%20'http%3A%2F%2Fthinkphp.ro%2Fapps%2FYQL%2FgetFlickrBy%2520YQLExecute%2Fflickrlist.xml'%20as%20flickr%3B%20%0A%0ASELECT%20*%20%0A%0AFROM%20flickr%20%0A%0AWHERE%20text%3D'{text}'%20AND%20location%3D'{location}'%20AND%20amount%3D{amount}%0A", | |
| data: { | |
| format: 'xml' | |
| } | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Request.Flickr = new Class({ | |
| Extends: Request.JSONP, | |
| options: { | |
| url: "http://query.yahooapis.com/v1/public/yql?q=use%20'http%3A%2F%2Fthinkphp.ro%2Fapps%2FYQL%2FgetFlickrBy%2520YQLExecute%2Fflickrlist.xml'%20as%20flickr%3B%20%0A%0ASELECT%20*%20%0A%0AFROM%20flickr%20%0A%0AWHERE%20text%3D'{text}'%20AND%20location%3D'{location}'%20AND%20amount%3D{amount}%0A", | |
| data: { | |
| format: 'xml' | |
| } | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Request.Flickr = new Class({ | |
| Extends: Request.JSONP, | |
| options: { | |
| url: "http://thinkphp.ro/apps/YQL/getFlickrBy/getFlickrBy.php?user={username}", | |
| data: { | |
| amount: 15, | |
| size: 's', | |
| format: 'json' | |
| } |
OlderNewer