From ad85374f65141071f33df5721e10c35790ab4fcc Mon Sep 17 00:00:00 2001 From: voyageravv Date: Tue, 15 Mar 2016 02:41:12 +0100 Subject: [PATCH 1/4] Added files via upload Index.php for API service --- index.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 index.php diff --git a/index.php b/index.php new file mode 100644 index 0000000..2304569 --- /dev/null +++ b/index.php @@ -0,0 +1,32 @@ +get( + 'statuses/home_timeline', + array( + 'screen_name' => $id, + 'count' => $limit + ) + ); +$tweets=array(); +$i=0; + if(!empty($twitterData)){ + foreach($twitterData as $tweet){ + if (!empty($tweet->id)) + { + $tweets[$i]['tweet_date']=date("YM d H:i:sTZY",strtotime($tweet->created_at)); + $tweets[$i]['response']=$tweet->text; + $i++; + } + } + } +$result['tweets']=$tweets; +echo json_encode($result); +?> From 4f1eefea0b317e973e7b0f43ba16e13ed57137d0 Mon Sep 17 00:00:00 2001 From: voyageravv Date: Tue, 15 Mar 2016 02:47:06 +0100 Subject: [PATCH 2/4] Update README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 2905e11..1b60a5c 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,17 @@ Tweetable also supports [timeago](https://github.com/rmm5t/jquery-timeago). for cacheInMilliseconds {Integer} // Time to keep the most recent tweets in cache before requesting new ones onComplete: {Object} // Function callback after event triggered +To get CONSUMER KEY, CONSUMER SECRET, and access Tokens, you must create an app in your twitter account + +https://apps.twitter.com/ + +Requeriments: Abraham's TwitterOauth, you can download in: +https://twitteroauth.com/ + + ### Changelog +#### 2.2 +* Added API for remote twitter #### 2.1 * Added caching for improved performance From 8d2bf8d745cabfa4aee7823e329b55807ba7c67f Mon Sep 17 00:00:00 2001 From: voyageravv Date: Tue, 15 Mar 2016 02:49:30 +0100 Subject: [PATCH 3/4] Update tweetable.jquery.js --- tweetable.jquery.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tweetable.jquery.js b/tweetable.jquery.js index 1844999..be287ec 100755 --- a/tweetable.jquery.js +++ b/tweetable.jquery.js @@ -21,7 +21,7 @@ var tweetList = jQuery('
    ')[opts.position.toLowerCase() + 'To'](act); var shortMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]; // var api = "http://api.getmytweets.co.uk/?screenname="; - var api = "http://plugins.theodin.co.uk/tweetable/statuses/?screen_name="; + var api = "index.php?screen_name="; var limitcount = "&limit="; var callback = "&callback=?"; var tweetMonth; @@ -234,4 +234,4 @@ }; })(jQuery); -jQuery.support.cors = true; \ No newline at end of file +jQuery.support.cors = true; From 6440701c776f37e00b4340db2a6102b76922df46 Mon Sep 17 00:00:00 2001 From: voyageravv Date: Tue, 15 Mar 2016 02:52:06 +0100 Subject: [PATCH 4/4] Update tweetable.jquery.min.js --- tweetable.jquery.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tweetable.jquery.min.js b/tweetable.jquery.min.js index 437b8fa..eb8a9db 100644 --- a/tweetable.jquery.min.js +++ b/tweetable.jquery.min.js @@ -10,4 +10,4 @@ * Revision: $Id: jquery.tweetable.min.js 2013-12-10 $ * */ -(function(e){jQuery.fn.tweetable=function(t){t=e.extend({},e.fn.tweetable.options,t);return this.each(function(){function c(){if(window.localStorage){var e=JSON.parse(localStorage.getItem("tweetable"));if(!e){return false}var n=e&&e.timestamp||0;return p(n,t.cacheInMilliseconds)}}function h(e){if(window.localStorage){var t=JSON.parse(localStorage.getItem("tweetable"));return t.value}}function p(e,t){var n=(new Date).getTime();return n-t<=e}function d(e){localStorage.removeItem(e)}function v(e){if(window.localStorage){var t={value:e,timestamp:(new Date).getTime()};localStorage.setItem("tweetable",JSON.stringify(t))}}function m(){jQuery("#tweet_loader").remove()}function g(){n.append('

    '+t.loading+"

    ")}function y(){n.append('
  • ")}function b(e,t){n.append('
  • ")}function w(e){return e&&e.error||null}function E(e,n){var i;var s;for(s=0;s<=12;s++){if(r[s]===n.tweet_date.substr(4,3)){a=s++;u=a<=9?"0"+a:a}}i=n.tweet_date.substr(26,4)+"-"+u+"-"+n.tweet_date.substr(8,2)+"T"+n.tweet_date.substr(11,8)+"Z";jQuery(".tweet_link_"+e).append('

    <'+(t.html5?'time datetime="'+i+'"':"small")+"> "+n.tweet_date.substr(8,2)+"/"+u+"/"+n.tweet_date.substr(26,4)+", "+n.tweet_date.substr(11,5)+"

    ")}function S(){function o(){e.eq(i++).fadeOut(400,function(){i=i===r?0:i;e.eq(i).fadeIn(400)})}var e=n.find("li");var r=e.length||null;var i=0;var s=t.speed;if(!r){return}e.slice(1).hide();setInterval(o,s)}function x(e){if(w(e)){y();return}else{v(e)}jQuery.each(e,function(e,n){if(e>=t.limit){return}b(e,n);if(t.time===true){E(e,n)}});if(t.rotate===true){S()}t.onComplete(n)}var e=jQuery(this);var n=jQuery('
      ')[t.position.toLowerCase()+"To"](e);var r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var i="http://api.getmytweets.co.uk/?screenname=";var s="&limit=";var o="&callback=?";var u;var a;var f;var l;if(c()){var T=h();x(T)}else{g();jQuery.getJSON(i+t.username+s+t.limit).done(function(e){m();x(e.tweets)}).fail(function(e,t,n){m();y();return})}})};e.fn.tweetable.options={limit:5,username:"philipbeel",time:false,rotate:false,speed:5e3,replies:false,position:"append",failed:"No tweets available",loading:"Loading tweets...",html5:false,retweets:false,cacheInMilliseconds:36e5,onComplete:function(e){}}})(jQuery);jQuery.support.cors=true \ No newline at end of file +(function(e){jQuery.fn.tweetable=function(t){t=e.extend({},e.fn.tweetable.options,t);return this.each(function(){function c(){if(window.localStorage){var e=JSON.parse(localStorage.getItem("tweetable"));if(!e){return false}var n=e&&e.timestamp||0;return p(n,t.cacheInMilliseconds)}}function h(e){if(window.localStorage){var t=JSON.parse(localStorage.getItem("tweetable"));return t.value}}function p(e,t){var n=(new Date).getTime();return n-t<=e}function d(e){localStorage.removeItem(e)}function v(e){if(window.localStorage){var t={value:e,timestamp:(new Date).getTime()};localStorage.setItem("tweetable",JSON.stringify(t))}}function m(){jQuery("#tweet_loader").remove()}function g(){n.append('

      '+t.loading+"

      ")}function y(){n.append('
    • ")}function b(e,t){n.append('
    • ")}function w(e){return e&&e.error||null}function E(e,n){var i;var s;for(s=0;s<=12;s++){if(r[s]===n.tweet_date.substr(4,3)){a=s++;u=a<=9?"0"+a:a}}i=n.tweet_date.substr(26,4)+"-"+u+"-"+n.tweet_date.substr(8,2)+"T"+n.tweet_date.substr(11,8)+"Z";jQuery(".tweet_link_"+e).append('

      <'+(t.html5?'time datetime="'+i+'"':"small")+"> "+n.tweet_date.substr(8,2)+"/"+u+"/"+n.tweet_date.substr(26,4)+", "+n.tweet_date.substr(11,5)+"

      ")}function S(){function o(){e.eq(i++).fadeOut(400,function(){i=i===r?0:i;e.eq(i).fadeIn(400)})}var e=n.find("li");var r=e.length||null;var i=0;var s=t.speed;if(!r){return}e.slice(1).hide();setInterval(o,s)}function x(e){if(w(e)){y();return}else{v(e)}jQuery.each(e,function(e,n){if(e>=t.limit){return}b(e,n);if(t.time===true){E(e,n)}});if(t.rotate===true){S()}t.onComplete(n)}var e=jQuery(this);var n=jQuery('
        ')[t.position.toLowerCase()+"To"](e);var r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var i="index.php?screenname=";var s="&limit=";var o="&callback=?";var u;var a;var f;var l;if(c()){var T=h();x(T)}else{g();jQuery.getJSON(i+t.username+s+t.limit).done(function(e){m();x(e.tweets)}).fail(function(e,t,n){m();y();return})}})};e.fn.tweetable.options={limit:5,username:"philipbeel",time:false,rotate:false,speed:5e3,replies:false,position:"append",failed:"No tweets available",loading:"Loading tweets...",html5:false,retweets:false,cacheInMilliseconds:36e5,onComplete:function(e){}}})(jQuery);jQuery.support.cors=true