Permalink
Browse files

Use official twitter widget instead

  • Loading branch information...
weierophinney committed Nov 17, 2012
1 parent eb9c724 commit bef5365a9f8ffa982525c3f186468ab1a95499bc
Showing with 3 additions and 54 deletions.
  1. +0 −1 .vimproject
  2. +0 −47 module/Application/public/js/tweets.js
  3. +3 −6 module/Application/view/pages/home.phtml
View
@@ -72,7 +72,6 @@ mwop=/home/matthew/git/sites/mwop CD=. filter="README TODO.md *.php *.xml *.txt
js=js filter="*.js" {
blog.js
scroll.js
- tweets.js
}
}
src=src {
@@ -1,47 +0,0 @@
-/*
- * Based on
- * http://dojotoolkit.org/documentation/tutorials/1.7/jsonp/
- * by Dustin Machi
- *
- * and
- * http://lupomontero.e-noise.com/blog/fetching-tweets-with-jquery-and-the-twitter-json-api
- *
- * by Lupo Montero
- */
-require(["dojo/io/script", "dojo/dom", "dojo/_base/array", "dojo/domReady!"],
-function(ioScript, dom, arrayUtil) {
- ioScript.get({
- url: "http://search.twitter.com/search.json",
- content: {q: "from:weierophinney", rpp: 30},
- callbackParamName: "callback"
- }).then(function(data) {
- return data.results;
- }).then(function(results) {
- var tweets = [];
- var count = 0;
- arrayUtil.some(results, function(item, index) {
- var replyRe = /^@/;
- var matched = replyRe.exec(item.text);
- if (matched) {
- return true;
- }
-
- var date_tweet = new Date(item.created_at);
- var date_now = new Date();
- var date_diff = date_now - date_tweet;
- var hours = Math.round(date_diff/(1000*60*60));
- var tweet;
-
- tweet = '<li><a href="http://www.twitter.com/weierophinney/status/' + item.id_str + '">';
- tweet += item.text;
- tweet += "</a> (" + hours + " hours ago)</li>";
- tweets.push(tweet);
-
- count += 1;
- if (5 >= count) {
- return false;
- }
- });
- dom.byId("tweets").innerHTML = tweets.join("");
- });
-});
@@ -1,6 +1,3 @@
-<?php
-$this->headScript()->appendScript('require(["Application/tweets"]);')
-?>
<article class="one-third column alpha home">
<h2>Welcome!</h2>
@@ -39,8 +36,8 @@ $this->headScript()->appendScript('require(["Application/tweets"]);')
<aside class="one-third column omega home">
<?php echo $this->render('github-links'); ?>
- <h3>Recent Tweets</h3>
- <ul id="tweets"></ul>
- <p><em><a href="http://twitter.com/weierophinney">View more tweets</a></em></p>
+ <a class="twitter-timeline" href="https://twitter.com/weierophinney" data-widget-id="269876420560420864">Tweets by @weierophinney</a>
+<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
+
</aside>

0 comments on commit bef5365

Please sign in to comment.