From 4e665073a98e47a99e1b289a7d2f20fc4b03968a Mon Sep 17 00:00:00 2001 From: Steven Lovegrove Date: Fri, 7 Oct 2016 21:11:54 -0700 Subject: [PATCH] Fix twitter feed loading and simplify, allowing custom twitter streams without new pages. --- 500px/index.html | 139 ---------------------- GettyImages/index.html | 139 ---------------------- MagnumPhotos/index.html | 139 ---------------------- PhotoBlggr/index.html | 139 ---------------------- TelegraphPics/index.html | 139 ---------------------- ads/index.html | 148 ------------------------ archillect/index.html | 139 ---------------------- big_picture/index.html | 139 ---------------------- earth/index.html | 139 ---------------------- history/index.html | 139 ---------------------- index.html | 30 ++--- ig.html => instagram/index.html | 9 +- js/fetch_eo1_image.js | 62 ++++++++++ instafeed.min.js => js/instafeed.min.js | 0 js/twitterFetcher_min.js | 23 ++++ life/index.html | 139 ---------------------- nasa/index.html | 139 ---------------------- nytimesphoto/index.html | 139 ---------------------- soylent/index.html | 139 ---------------------- tweegeemee/index.html | 139 ---------------------- twitter/index.html | 40 +++++++ v2/index.html | 139 ---------------------- 22 files changed, 143 insertions(+), 2254 deletions(-) delete mode 100755 500px/index.html delete mode 100755 GettyImages/index.html delete mode 100755 MagnumPhotos/index.html delete mode 100755 PhotoBlggr/index.html delete mode 100755 TelegraphPics/index.html delete mode 100755 ads/index.html delete mode 100755 archillect/index.html delete mode 100755 big_picture/index.html delete mode 100755 earth/index.html delete mode 100755 history/index.html rename ig.html => instagram/index.html (83%) create mode 100644 js/fetch_eo1_image.js rename instafeed.min.js => js/instafeed.min.js (100%) create mode 100644 js/twitterFetcher_min.js delete mode 100755 life/index.html delete mode 100755 nasa/index.html delete mode 100755 nytimesphoto/index.html delete mode 100755 soylent/index.html delete mode 100755 tweegeemee/index.html create mode 100755 twitter/index.html delete mode 100755 v2/index.html diff --git a/500px/index.html b/500px/index.html deleted file mode 100755 index 5b45c14..0000000 --- a/500px/index.html +++ /dev/null @@ -1,139 +0,0 @@ - - - EO1 Screen - 500px - - - - -
- - - \ No newline at end of file diff --git a/GettyImages/index.html b/GettyImages/index.html deleted file mode 100755 index 076542b..0000000 --- a/GettyImages/index.html +++ /dev/null @@ -1,139 +0,0 @@ - - - EO1 Screen - Getty Images - - - - -
- - - \ No newline at end of file diff --git a/MagnumPhotos/index.html b/MagnumPhotos/index.html deleted file mode 100755 index a8fe695..0000000 --- a/MagnumPhotos/index.html +++ /dev/null @@ -1,139 +0,0 @@ - - - EO1 Screen - Magnum Photos - - - - -
- - - \ No newline at end of file diff --git a/PhotoBlggr/index.html b/PhotoBlggr/index.html deleted file mode 100755 index 16d04a6..0000000 --- a/PhotoBlggr/index.html +++ /dev/null @@ -1,139 +0,0 @@ - - - EO1 Screen - Photography Blogger - - - - -
- - - \ No newline at end of file diff --git a/TelegraphPics/index.html b/TelegraphPics/index.html deleted file mode 100755 index ee0ced2..0000000 --- a/TelegraphPics/index.html +++ /dev/null @@ -1,139 +0,0 @@ - - - EO1 Screen - Telegraph Pictures - - - - -
- - - \ No newline at end of file diff --git a/ads/index.html b/ads/index.html deleted file mode 100755 index 13039e0..0000000 --- a/ads/index.html +++ /dev/null @@ -1,148 +0,0 @@ - - - EO1 Screen - Ads - - - - -
-
- - - \ No newline at end of file diff --git a/archillect/index.html b/archillect/index.html deleted file mode 100755 index 3308d0a..0000000 --- a/archillect/index.html +++ /dev/null @@ -1,139 +0,0 @@ - - - EO1 Screen - Archillect - - - - -
- - - \ No newline at end of file diff --git a/big_picture/index.html b/big_picture/index.html deleted file mode 100755 index 791082f..0000000 --- a/big_picture/index.html +++ /dev/null @@ -1,139 +0,0 @@ - - - EO1 Screen - The Big Picture - - - - -
- - - \ No newline at end of file diff --git a/earth/index.html b/earth/index.html deleted file mode 100755 index ef7eb38..0000000 --- a/earth/index.html +++ /dev/null @@ -1,139 +0,0 @@ - - - EO1 Screen - Earth - - - - -
- - - \ No newline at end of file diff --git a/history/index.html b/history/index.html deleted file mode 100755 index f660161..0000000 --- a/history/index.html +++ /dev/null @@ -1,139 +0,0 @@ - - - EO1 Screen - History - - - - -
- - - \ No newline at end of file diff --git a/index.html b/index.html index 053027c..e0fcb81 100755 --- a/index.html +++ b/index.html @@ -66,46 +66,46 @@

Available Displays

These are the available image feeds currently. More coming soon!

-

NASAGoddardPix - @NASAGoddardPix on Twitter

We share cool science…this is the official image/video tweeting account for @NASAGoddard. +

NASAGoddardPix - @NASAGoddardPix on Twitter

We share cool science…this is the official image/video tweeting account for @NASAGoddard.
-

EarthPix - @EarthPix on Twitter

Amazing pictures of places, people, animals, and nature. +

EarthPix - @EarthPix on Twitter

Amazing pictures of places, people, animals, and nature.
-

History In Pics - @HistoryInPics on Twitter

Sharing the most powerful and entertaining historical photographs ever taken. +

History In Pics - @HistoryInPics on Twitter

Sharing the most powerful and entertaining historical photographs ever taken.
-

LIFE - @LIFE on Twitter

Incredible stories and treasured photographs from the LIFE archive. +

LIFE - @LIFE on Twitter

Incredible stories and treasured photographs from the LIFE archive.
-

Brilliant_Ads - @Brilliant_Ads on Twitter

The most creative, unique, controversial, remarkable and powerful ads, signs and marketing related things from around the world. +

Brilliant_Ads - @Brilliant_Ads on Twitter

The most creative, unique, controversial, remarkable and powerful ads, signs and marketing related things from around the world.
-

Archillect - @archillect on Twitter

The ocular engine. +

Archillect - @archillect on Twitter

The ocular engine.
-

Photography Blogger - @PhotoBlggr on Twitter

Inspiring photographers with some great photography subjects. +

Photography Blogger - @PhotoBlggr on Twitter

Inspiring photographers with some great photography subjects.
-

The Big Picture - @big_picture on Twitter

The Big Picture is a photo blog created by the photo editors of @BostonGlobe, with the best in photojournalism from around the world. +

The Big Picture - @big_picture on Twitter

The Big Picture is a photo blog created by the photo editors of @BostonGlobe, with the best in photojournalism from around the world.
-

Telegraph Pictures - @TelegraphPics on Twitter

Photo galleries and the latest news pictures from http://Telegraph.co.uk +

Telegraph Pictures - @TelegraphPics on Twitter

Photo galleries and the latest news pictures from http://Telegraph.co.uk
-

NYTimes Photo - @nytimesphoto on Twitter

Tweeting about photography and visual journalism in the news and on our radar. +

NYTimes Photo - @nytimesphoto on Twitter

Tweeting about photography and visual journalism in the news and on our radar.
-

Magnum Photos - @MagnumPhotos on Twitter

Magnum Photos is a photographic cooperative of great diversity and distinction owned by its photographer members. +

Magnum Photos - @MagnumPhotos on Twitter

Magnum Photos is a photographic cooperative of great diversity and distinction owned by its photographer members.
-

500px - @500px on Twitter

500px is the premier photography community and licensing marketplace. Follow us for awesome photos every day. +

500px - @500px on Twitter

500px is the premier photography community and licensing marketplace. Follow us for awesome photos every day.
-

Getty Images - @GettyImages on Twitter

Moving the world with images. +

Getty Images - @GettyImages on Twitter

Moving the world with images.
-

Tweegeemee Bot - @tweegeemee on Twitter

I'm a #Clojure twitterbot by @RogerAllen. Favorite & retweet my images to select them for future genetic algorithm breeding. +

Tweegeemee Bot - @tweegeemee on Twitter

I'm a #Clojure twitterbot by @RogerAllen. Favorite & retweet my images to select them for future genetic algorithm breeding.

Instagram Feed

@@ -120,7 +120,7 @@

Contact Info

+ - \ No newline at end of file + diff --git a/js/fetch_eo1_image.js b/js/fetch_eo1_image.js new file mode 100644 index 0000000..ef20029 --- /dev/null +++ b/js/fetch_eo1_image.js @@ -0,0 +1,62 @@ +function handlePics(tweets) { + for (var i = 0; i < tweets.length; i++) { + try { + var tweet = tweets[i]; + var temp = document.getElementById('temp'); + temp.innerHTML = tweet; + var img = document.getElementsByTagName('img')[0]; + var imgUrl = img.src; + if (imgUrl != undefined) { + setBackground(imgUrl); + temp.remove(); + break; + }; + } + catch(err) { + continue + } + } +} + +function setBackground(imgUrl) { + var htmlElement = document.getElementsByTagName("html")[0]; + htmlElement.style.background = "url(" + imgUrl + ") no-repeat center center fixed"; + htmlElement.style.backgroundSize = "cover"; +} + +function getSearchParameters() { + var prmstr = window.location.search.substr(1); + return prmstr != null && prmstr != "" ? transformToAssocArray(prmstr) : {}; +} + +function transformToAssocArray( prmstr ) { + var params = {}; + var prmarr = prmstr.split("&"); + for ( var i = 0; i < prmarr.length; i++) { + var tmparr = prmarr[i].split("="); + params[tmparr[0]] = tmparr[1]; + } + return params; +} + +function fetchTwitterImagesForEO1( twitter_id ) { + // ##### Main Configuration ##### + // Pulls 20 tweets and traverses them for the first image. + // Strips out everything except for the first image. + var config = { + "id": twitter_id, + "domId": '', + "maxTweets": 20, + "enableLinks": false, + "showUser": false, + "showTime": false, + "showPermalinks": true, + "showImages": true, + "showRetweet": false, + "showInteraction": false, + "customCallback": handlePics + }; + + twitterFetcher.fetch(config); +} + diff --git a/instafeed.min.js b/js/instafeed.min.js similarity index 100% rename from instafeed.min.js rename to js/instafeed.min.js diff --git a/js/twitterFetcher_min.js b/js/twitterFetcher_min.js new file mode 100644 index 0000000..3ecee86 --- /dev/null +++ b/js/twitterFetcher_min.js @@ -0,0 +1,23 @@ +/********************************************************************* +* #### Twitter Post Fetcher v16.0.2 #### +* Coded by Jason Mayes 2015. A present to all the developers out there. +* www.jasonmayes.com +* Please keep this disclaimer with my code if you use it. Thanks. :-) +* Got feedback or questions, ask here: +* http://www.jasonmayes.com/projects/twitterApi/ +* Github: https://github.com/jasonmayes/Twitter-Post-Fetcher +* Updates will be posted to this site. +*********************************************************************/ +(function(E,q){"function"===typeof define&&define.amd?define([],q):"object"===typeof exports?module.exports=q():q()})(this,function(){function E(a){if(null===t){for(var f=a.length,b=0,k=document.getElementById(F),g=""}else t(a)}function q(a){return a.replace(/]*>(.*?)<\/b>/gi,function(a,b){return b}).replace(/class="(?!(tco-hidden|tco-display|tco-ellipsis))+.*?"|data-query-source=".*?"|dir=".*?"|rel=".*?"/gi,"")}function G(a){a=a.getElementsByTagName("a"); +for(var f=a.length-1;0<=f;f--)a[f].setAttribute("target","_blank")}function l(a,f){for(var b=[],k=new RegExp("(^| )"+f+"( |$)"),g=a.getElementsByTagName("*"),h=0,d=g.length;h]*>)|(]*>)/g,"");u||(a.body=a.body.replace(/(]*>|(]*>))/g, +""));n||(a.body=a.body.replace(/(]*>)/g,""));var b=document.createElement("div");b.innerHTML=a.body;"undefined"===typeof b.getElementsByClassName&&(C=!1);a=[];var k=[],g=[],h=[],d=[],r=[],p=[],e=0;if(C)for(b=b.getElementsByClassName("timeline-Tweet");ef&&(a.splice(f,a.length-f),k.splice(f,k.length-f),g.splice(f,g.length-f),d.splice(f,d.length-f),h.splice(f,h.length-f),p.splice(f,p.length-f));var b=[],e=a.length,c=0;if(K)for(;c"),d+='

'+q(a[c].innerHTML)+"

",A&&(d=J?d+('

'+g[c].getAttribute("aria-label")+"

"):d+('

'+g[c].getAttribute("aria-label")+"

"))):(n&&(d+='

'+k[c].textContent+"

"),d+='

'+a[c].textContent+"

",A&&(d+='

'+g[c].textContent+"

"));I&&(d+='

");u&&void 0!==h[c]&&void 0!==y(h[c])&&(d+='
Image from tweet
');u?b.push(d):!u&&a[c].textContent.length&& +b.push(d);c++}E(b);z=!1;0 - - EO1 Screen - LIFE - - - - -
- - - \ No newline at end of file diff --git a/nasa/index.html b/nasa/index.html deleted file mode 100755 index 25bedf3..0000000 --- a/nasa/index.html +++ /dev/null @@ -1,139 +0,0 @@ - - - EO1 Screen - NASA - - - - -
- - - \ No newline at end of file diff --git a/nytimesphoto/index.html b/nytimesphoto/index.html deleted file mode 100755 index bc586f1..0000000 --- a/nytimesphoto/index.html +++ /dev/null @@ -1,139 +0,0 @@ - - - EO1 Screen - NYTimes Photo - - - - -
- - - \ No newline at end of file diff --git a/soylent/index.html b/soylent/index.html deleted file mode 100755 index 1a7c9d6..0000000 --- a/soylent/index.html +++ /dev/null @@ -1,139 +0,0 @@ - - - EO1 Screen - Soylent - - - - -
- - - \ No newline at end of file diff --git a/tweegeemee/index.html b/tweegeemee/index.html deleted file mode 100755 index 151f58a..0000000 --- a/tweegeemee/index.html +++ /dev/null @@ -1,139 +0,0 @@ - - - EO1 Screen - Tweegeemee - - - - -
- - - \ No newline at end of file diff --git a/twitter/index.html b/twitter/index.html new file mode 100755 index 0000000..45e08b6 --- /dev/null +++ b/twitter/index.html @@ -0,0 +1,40 @@ + + + EO1 Screen - The Big Picture + + + + + + +
+ + + + + diff --git a/v2/index.html b/v2/index.html deleted file mode 100755 index e91ebac..0000000 --- a/v2/index.html +++ /dev/null @@ -1,139 +0,0 @@ - - - EO1 Screen - Ads - - - - -
- - - \ No newline at end of file