-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de935e9
commit a7a8e1f
Showing
8 changed files
with
90 additions
and
90 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,8 @@ | |
"authors": [ | ||
"Jonathan Hornung <[email protected]>" | ||
], | ||
"version": "0.7.0", | ||
"description": "twitter plugin for apiNG", | ||
"version": "0.7.5", | ||
"description": "Twitter plugin for apiNG", | ||
"main": "dist/aping-plugin-codebird.min.js", | ||
"moduleType": [], | ||
"keywords": [ | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
/** | ||
@name: aping-plugin-codebird | ||
@version: 0.7.0 (09-01-2016) | ||
@author: Jonathan Hornung | ||
@url: https://github.com/JohnnyTheTank/apiNG-plugin-codebird#readme | ||
@version: 0.7.5 (10-01-2016) | ||
@author: Jonathan Hornung <[email protected]> | ||
@url: https://github.com/JohnnyTheTank/apiNG-plugin-codebird | ||
@license: MIT | ||
*/ | ||
"use strict"; | ||
|
@@ -28,46 +28,46 @@ var jjtApingCodebird = angular.module("jtt_aping_codebird", []) | |
//create helperObject for helper function call | ||
var helperObject = { | ||
model: appSettings.model, | ||
showAvatar : request.showAvatar || false, | ||
showAvatar: request.showAvatar || false, | ||
}; | ||
if(typeof appSettings.getNativeData !== "undefined") { | ||
if (typeof appSettings.getNativeData !== "undefined") { | ||
helperObject.getNativeData = appSettings.getNativeData; | ||
} else { | ||
helperObject.getNativeData = false; | ||
} | ||
|
||
//create requestObject for api request call | ||
var requestObject = {}; | ||
if(typeof request.items !== "undefined") { | ||
if (typeof request.items !== "undefined") { | ||
requestObject.count = request.items; | ||
} else { | ||
requestObject.count = appSettings.items; | ||
} | ||
|
||
if(requestObject.count == 0) { | ||
if (requestObject.count == 0) { | ||
return false; | ||
} | ||
|
||
// -1 is "no explicit limit". same for NaN value | ||
if(requestObject.count < 0 || isNaN(requestObject.count)) { | ||
if (requestObject.count < 0 || isNaN(requestObject.count)) { | ||
requestObject.count = undefined; | ||
} | ||
|
||
// the api has a limit of 100 items per request | ||
if(requestObject.count > 100) { | ||
if (requestObject.count > 100) { | ||
requestObject.count = 100; | ||
} | ||
|
||
if(request.search) { | ||
if (request.search) { | ||
// https://dev.twitter.com/rest/reference/get/search/tweets | ||
requestObject.q = request.search; | ||
requestObject.result_type = request.result_type || "mixed"; | ||
|
||
if(typeof request.lat !== "undefined" && typeof request.lng !== "undefined") { | ||
requestObject.geocode = request.lat+","+request.lng+","+(request.distance || "1" )+"km"; | ||
if (typeof request.lat !== "undefined" && typeof request.lng !== "undefined") { | ||
requestObject.geocode = request.lat + "," + request.lng + "," + (request.distance || "1" ) + "km"; | ||
} | ||
|
||
if(typeof request.language !== "undefined") { | ||
if (typeof request.language !== "undefined") { | ||
requestObject.lang = request.language; | ||
} | ||
|
||
|
@@ -81,17 +81,17 @@ var jjtApingCodebird = angular.module("jtt_aping_codebird", []) | |
true | ||
); | ||
|
||
} else if(request.user) { | ||
} else if (request.user) { | ||
// https://dev.twitter.com/rest/reference/get/statuses/user_timeline | ||
|
||
requestObject.screen_name = request.user; | ||
requestObject.contributor_details = true; | ||
|
||
if(request.exclude_replies === true || request.exclude_replies === "true"){ | ||
if (request.exclude_replies === true || request.exclude_replies === "true") { | ||
requestObject.exclude_replies = true; | ||
} | ||
|
||
if(request.include_rts === false || request.include_rts === "false"){ | ||
if (request.include_rts === false || request.include_rts === "false") { | ||
requestObject.include_rts = false; | ||
} | ||
|
||
|
@@ -124,22 +124,22 @@ jjtApingCodebird.service('apingCodebirdHelper', ['apingModels', 'apingTimeHelper | |
return _smallImageUrl.replace("_normal", ""); | ||
}; | ||
this.getImageUrlFromMediaObject = function (_item) { | ||
if(_item) { | ||
if(_item.media_url_https) { | ||
if (_item) { | ||
if (_item.media_url_https) { | ||
return this.getBigImageUrlFromSmallImageUrl(_item.media_url_https); | ||
} | ||
if(_item.media_url) { | ||
if (_item.media_url) { | ||
return this.getBigImageUrlFromSmallImageUrl(_item.media_url); | ||
} | ||
} | ||
return undefined; | ||
}; | ||
this.getImageUrlFromUserObject = function (_item) { | ||
if(_item) { | ||
if(_item.profile_image_url_https) { | ||
if (_item) { | ||
if (_item.profile_image_url_https) { | ||
return this.getBigImageUrlFromSmallImageUrl(_item.profile_image_url_https); | ||
} | ||
if(_item.profile_image_url) { | ||
if (_item.profile_image_url) { | ||
return this.getBigImageUrlFromSmallImageUrl(_item.profile_image_url); | ||
} | ||
} | ||
|
@@ -161,25 +161,25 @@ jjtApingCodebird.service('apingCodebirdHelper', ['apingModels', 'apingTimeHelper | |
|
||
var baseUrl = this.getImageUrlFromMediaObject(_item); | ||
|
||
if(_item.sizes) { | ||
if(typeof _item.sizes['small'] !== "undefined") { | ||
returnObject.thumb_url = baseUrl+":small"; | ||
if (_item.sizes) { | ||
if (typeof _item.sizes['small'] !== "undefined") { | ||
returnObject.thumb_url = baseUrl + ":small"; | ||
returnObject.thumb_width = _item.sizes['small'].w || undefined; | ||
returnObject.thumb_height = _item.sizes['small'].h || undefined; | ||
} else { | ||
returnObject.thumb_url = baseUrl; | ||
} | ||
|
||
if(typeof _item.sizes['medium'] !== "undefined") { | ||
returnObject.img_url = baseUrl+":medium"; | ||
if (typeof _item.sizes['medium'] !== "undefined") { | ||
returnObject.img_url = baseUrl + ":medium"; | ||
returnObject.img_width = _item.sizes['medium'].w || undefined; | ||
returnObject.img_height = _item.sizes['medium'].h || undefined; | ||
} else { | ||
returnObject.img_url = baseUrl; | ||
} | ||
|
||
if(typeof _item.sizes['large'] !== "undefined") { | ||
returnObject.native_url = baseUrl+":large"; | ||
if (typeof _item.sizes['large'] !== "undefined") { | ||
returnObject.native_url = baseUrl + ":large"; | ||
returnObject.native_width = _item.sizes['large'].w || undefined; | ||
returnObject.native_height = _item.sizes['large'].h || undefined; | ||
} else { | ||
|
@@ -200,14 +200,14 @@ jjtApingCodebird.service('apingCodebirdHelper', ['apingModels', 'apingTimeHelper | |
|
||
angular.forEach(_data.statuses, function (value, key) { | ||
var tempResult = _this.getItemByJsonData(value, _helperObject); | ||
if(tempResult) { | ||
if (tempResult) { | ||
requestResults.push(tempResult); | ||
} | ||
}); | ||
} else if (_data.length > 0) { | ||
angular.forEach(_data, function (value, key) { | ||
var tempResult = _this.getItemByJsonData(value, _helperObject); | ||
if(tempResult) { | ||
if (tempResult) { | ||
requestResults.push(tempResult); | ||
} | ||
}); | ||
|
@@ -222,7 +222,7 @@ jjtApingCodebird.service('apingCodebirdHelper', ['apingModels', 'apingTimeHelper | |
var returnObject = {}; | ||
if (_item && _helperObject.model) { | ||
|
||
if(_helperObject.getNativeData === true || _helperObject.getNativeData === "true") { | ||
if (_helperObject.getNativeData === true || _helperObject.getNativeData === "true") { | ||
returnObject = this.getNativeItemByJsonData(_item, _helperObject.model); | ||
} else { | ||
switch (_helperObject.model) { | ||
|
@@ -258,21 +258,21 @@ jjtApingCodebird.service('apingCodebirdHelper', ['apingModels', 'apingTimeHelper | |
|
||
socialObject.date_time = new Date(socialObject.timestamp); | ||
|
||
if(_item.entities && _item.entities.media && _item.entities.media.length>0) { | ||
if (_item.entities && _item.entities.media && _item.entities.media.length > 0) { | ||
socialObject.source = _item.entities.media; | ||
socialObject.img_url = this.getImageUrlFromMediaObject(_item.entities.media[0]); | ||
} | ||
|
||
if(socialObject.img_url) { | ||
if (socialObject.img_url) { | ||
socialObject.type = "image"; | ||
} else { | ||
socialObject.type = "tweet"; | ||
if(_item.user && (_helperObject.showAvatar === true || _helperObject.showAvatar === 'true' ) ) { | ||
if (_item.user && (_helperObject.showAvatar === true || _helperObject.showAvatar === 'true' )) { | ||
socialObject.img_url = this.getImageUrlFromUserObject(_item.user); | ||
} | ||
} | ||
|
||
socialObject.post_url = socialObject.blog_link+"status/"+socialObject.intern_id; | ||
socialObject.post_url = socialObject.blog_link + "status/" + socialObject.intern_id; | ||
|
||
return socialObject; | ||
}; | ||
|
@@ -293,23 +293,23 @@ jjtApingCodebird.service('apingCodebirdHelper', ['apingModels', 'apingTimeHelper | |
|
||
imageObject.date_time = new Date(imageObject.timestamp); | ||
|
||
if(_item.entities && _item.entities.media && _item.entities.media.length>0) { | ||
if (_item.entities && _item.entities.media && _item.entities.media.length > 0) { | ||
|
||
imageObject.source = _item.entities.media; | ||
|
||
var tempImageArray = this.getImagesObjectFromMediaObject(_item.entities.media[0]); | ||
$.extend(true, imageObject, tempImageArray); | ||
|
||
if(!imageObject.img_url) { | ||
if (!imageObject.img_url) { | ||
imageObject.img_url = this.getImageUrlFromMediaObject(_item.entities.media[0]); | ||
} | ||
} | ||
|
||
if(!imageObject.img_url) { | ||
if (!imageObject.img_url) { | ||
return false; | ||
} | ||
|
||
imageObject.post_url = imageObject.blog_link+"status/"+imageObject.intern_id; | ||
imageObject.post_url = imageObject.blog_link + "status/" + imageObject.intern_id; | ||
|
||
return imageObject; | ||
}; | ||
|
@@ -320,7 +320,7 @@ jjtApingCodebird.service('apingCodebirdHelper', ['apingModels', 'apingTimeHelper | |
|
||
switch (_model) { | ||
case "image": | ||
if(!_item.entities || !_item.entities.media || !_item.entities.media.length>0 || !this.getImageUrlFromMediaObject(_item.entities.media[0])) { | ||
if (!_item.entities || !_item.entities.media || !_item.entities.media.length > 0 || !this.getImageUrlFromMediaObject(_item.entities.media[0])) { | ||
return false; | ||
} else { | ||
nativeItem = _item; | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "aping-plugin-codebird", | ||
"version": "0.7.0", | ||
"description": "twitter plugin for apiNG", | ||
"version": "0.7.5", | ||
"description": "Twitter plugin for apiNG", | ||
"main": "dist/aping-plugin-codebird.min.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
|
@@ -19,12 +19,12 @@ | |
"json", | ||
"angular" | ||
], | ||
"author": "Jonathan Hornung", | ||
"author": "Jonathan Hornung <[email protected]>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/JohnnyTheTank/apiNG-plugin-codebird/issues" | ||
}, | ||
"homepage": "https://github.com/JohnnyTheTank/apiNG-plugin-codebird#readme", | ||
"homepage": "https://github.com/JohnnyTheTank/apiNG-plugin-codebird", | ||
"devDependencies": { | ||
"codebird": "*", | ||
"grunt": "^0.4.5", | ||
|
This file contains 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
Oops, something went wrong.