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
| basket.require('javascript/Request.JSONP.js') | |
| .require('javascript/Request.YQL.min.js') | |
| .require('javascript/overlay.js') | |
| .require('javascript/MooDialog.js') | |
| .require('javascript/MooDialog.Request.js').wait(function(){ | |
| basket.require('javascript/domready.js') | |
| }) |
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(context, document) { | |
| "use strict"; | |
| var storagePrefix = "basket-", | |
| scripts = [], | |
| scriptsExecuted = 0, | |
| waitCount = 0, | |
| waitCallbacks = [], |
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
| <?php | |
| class Grid { | |
| public function build($datasource, $headers, $fields) { | |
| $out = '<table border="1">'; | |
| $out .= $this->_make_header($headers); | |
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
| /** | |
| * JSON Service for HTTP REST GET | |
| */ | |
| class JsonService { | |
| private $instance; | |
| public function __construct($instance) { | |
| $this->instance = $instance; |
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
| <?php | |
| //create a service Flickr photos | |
| require_once('jsonservice.php'); | |
| class Flickr { | |
| /** | |
| * Photos who's title, description, tags contain the text will be returned. | |
| * @param $text String - A free text search. |
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
| require_once('jsonservice.php'); | |
| class Twitter { | |
| const endpoint = 'http://twitter.com/statuses/user_timeline/'; | |
| public function get( $username, $count = 10 ) { | |
| //call private method _curl for retrieve the data from service API Twitter in format xml | |
| $statuses = $this->_curl( $username, $count ); |
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
| <?php | |
| $endpoint = 'http://thinkphp.ro/apps/ishackday/jsonservice/twitter.php/get?username=thinkphp'; | |
| $json = json_decode(file_get_contents($endpoint)); | |
| $response = $json->response; | |
| print_r($response); | |
| ?> |
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
| $endpoint = 'http://thinkphp.ro/apps/ishackday/jsonservice/flickr.php/get?text=beach'; | |
| $json = json_decode(get($endpoint)); | |
| $response = $json->response; | |
| function get($url) { | |
| $ch = curl_init(); | |
| curl_setopt($ch, CURLOPT_URL, $url); | |
| curl_setopt($ch, CURLOPT_HEADER, FALSE); |
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
| <?php | |
| //action: http://thinkphp.ro/apps/ishackday/jsonservice/getTweets.php | |
| if(isset($_GET['user'])): | |
| $user = $_GET['user']; | |
| else: | |
| $user = 'thinkphp'; | |
| endif; | |
| $endpoint = 'http://thinkphp.ro/apps/ishackday/jsonservice/twitter.php/get?username=' . $user ; |
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
| <?php | |
| require_once('jsonservice.php'); | |
| class Subsets { | |
| public function get( $n ) { | |
| return$ret = $this->_generate($n); | |
| } |