Skip to content

Commit

Permalink
Minor code improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro Rogerio committed Aug 6, 2014
1 parent e1e7450 commit 91e0cab
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
17 changes: 8 additions & 9 deletions hashtags/src/tweetlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* Tweetlight
* Display all tweets with a certain hashtag with pure JavaScript and PHP OAuth Library
* Example and documentation at: https://github.com/pinceladasdaweb/tweetlight
* Copyright (c) 2013
* Version: 3.0.0 (17-DEZ-2013)
* Copyright (c) 2014
* Version: 3.0.1 (Latest build: Aug 06 2014)
* Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
* Requires: Twitter API Authentication
---------------*/
Expand All @@ -16,8 +16,8 @@ var Browser = (function () {

var Tweetlight = {
init: function (config) {
this.url = './tweets.php?q=' + encodeURIComponent(config.query) + '&count=' + config.count;
this.container = config.container;
this.url = './tweets.php?q=' + encodeURIComponent(config.query) + '&count=' + config.count;
this.container = config.container;
this.onComplete = config.onComplete || function () {};
this.fetch();
},
Expand Down Expand Up @@ -51,11 +51,10 @@ var Tweetlight = {
var self = this;

self.getJSON({url: self.url}, function (data) {
var tweets = JSON.parse(data),
tweet = tweets.statuses;

var timeline = document.querySelector(self.container),
content = '';
var tweets = JSON.parse(data),
tweet = tweets.statuses,
timeline = document.querySelector(self.container),
content = '';

self.loop(tweet, function (res) {
content += '<li><span class="tweet"><a href="https://twitter.com/'+res.user.screen_name+'">'+res.user.screen_name+'</a>: '+self.twitterLinks(res.text)+'</span><span class="created">'+self.prettyDate(res.created_at)+'</span></li>';
Expand Down
4 changes: 2 additions & 2 deletions hashtags/src/tweetlight.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions user/src/tweetlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* Tweetlight
* Display your latest tweets with pure JavaScript and PHP OAuth Library
* Example and documentation at: https://github.com/pinceladasdaweb/tweetlight
* Copyright (c) 2013
* Version: 3.0.0 (17-DEZ-2013)
* Copyright (c) 2014
* Version: 3.0.1 (Latest build: Aug 06 2014)
* Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
* Requires: Twitter API Authentication
---------------*/
Expand All @@ -16,8 +16,8 @@ var Browser = (function () {

var Tweetlight = {
init: function (config) {
this.url = './tweets.php?username=' + config.username + '&count=' + config.count;
this.container = config.container;
this.url = './tweets.php?username=' + config.username + '&count=' + config.count;
this.container = config.container;
this.onComplete = config.onComplete || function () {};
this.fetch();
},
Expand Down
6 changes: 3 additions & 3 deletions user/src/tweetlight.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 91e0cab

Please sign in to comment.