cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmloctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <html>
  <head></head>
  <body>
    <h2>JavaScript Twitter API component - customizability demo!</h2>
    <a id="linkage" href="http://www.jasonmayes.com/projects/twitterApi/" target="blank">Visit my website</a>
    <p class="padder">New Twitter API broken tweets on your website? Dont want to use OAUTH? Here is my solution - just using JavaScript. It can even look however you want it to - just change the CSS to whatever you want as shown in this demo! Learn more at <a href="http://www.jasonmayes.com/projects/twitterAp">http://www.jasonmayes.com/projects/twitterApi/</a></p>
    <div id="example1"></div>
  </body>
</html>
            
          
!
            
              /* 
* Example style! Made very fast as proof of concept for someone,
* so apologies for messy code.
* You can do whatever the hell you want on your site :-)
*/

h2 {
  clear:both;
  text-align:center;
}


p, a {
  font-size:9pt;
  margin:0 0 0 0;
  color:#ffffff;
}

a, a:visited {
  color:#427fed;
}

a:hover {
  color:#82afff;
}

p.padder {
  padding-bottom:100px;
  color:#3d3d3d;
  text-align:center;
}

ul {
  margin:0;
  padding:0;
}

ul li {
  list-style:none;
  overflow:hidden;
  position:relative;
  width:100%;
  height:200px;
  background-color:transparent;
}

.tweet {
  width:100%;
  font-size:8pt;
  background-color:#3d3d3d;
  padding:10px;
  position:absolute;
  left:0;
  top:30px;
}

.interact {
  display:none;
}

.timePosted {
  width:96%;
  background-color:#3d3d3d;
  padding:2%;
  position:absolute;
  bottom:0;
  right:0;
}

.user span span {
  display:none;
}

.user a > span {
  padding:5px;
  background-color:#3d3d3d;
  position:absolute;
  top:0;
  left:0;
  right:40%;
}

.user, .user img, .user a {
  position:absolute;
  top:0;
  right:0;
  left:0;
  bottom:0;
}

.user img {
  width:200%;
  opacity: 0.8;
  z-index:-1;
}



@-moz-keyframes myCubeAnim {
  from {
    -moz-transform: rotateX(0deg) rotateY(0deg);
  }
  to{
    -moz-transform: rotateX(360deg) rotateY(360deg);
  }
}

@-webkit-keyframes myCubeAnim {
  from {
    -webkit-transform: rotateX(0deg) rotateY(0deg);
  }
  to{
    -webkit-transform: rotateX(360deg) rotateY(360deg);
  }
}

@-o-keyframes myCubeAnim {
  from {
    -o-transform: rotateX(0deg) rotateY(0deg);
  }
  to{
    -o-transform: rotateX(360deg) rotateY(360deg);
  }
}

@-ms-keyframes myCubeAnim {
  from {
    -ms-transform: rotateX(0deg) rotateY(0deg);
  }
  to{
    -ms-transform: rotateX(360deg) rotateY(360deg);
  }
}

@keyframes myCubeAnim {
  from {
    transform: rotateX(0deg) rotateY(0deg);
  }
  to{
    transform: rotateX(360deg) rotateY(360deg);
  }
}

#example1 {
  margin-top:20px;
  -webkit-perspective :1000;
  -moz-perspective    :1000;
  -o-perspective      :1000;
  -ms-perspective     :1000;
  perspective         :1000;

  -webkit-perspective-origin  :50% 50%;
  -moz-perspective-origin     :50% 50%;
  -moz-transform-origin       :50% 50%;
  -o-perspective-origin       :50% 50%;
  -ms-perspective-origin      :50% 50%;
  perspective-origin          :50% 50%;
}

ul {
  -webkit-animation :myCubeAnim 10s infinite linear;
  -moz-animation    :myCubeAnim 10s infinite linear;
  -o-animation      :myCubeAnim 10s infinite linear;
  -ms-animation     :myCubeAnim 10s infinite linear;
  animation         :myCubeAnim 10s infinite linear;
}

ul {
  position: relative;
  margin: 0 auto;
  height: 200px;
  width: 200px;

  -webkit-transition  :-webkit-transform 2s linear;
  -moz-transition     :-moz-transform 2s linear;
  -o-transition       :-o-transform 2s linear;
  -ms-transition      :-ms-transform 2s linear;
  transition          :transform 2s linear;

  -webkit-transform-style :preserve-3d;
  -moz-transform-style    :preserve-3d;
  -o-transform-style      :preserve-3d;
  -ms-transform-style     :preserve-3d;
  transform-style         :preserve-3d;
}

ul>li {
  position: absolute;
  height: 200px;
  width: 200px;
}

ul li:nth-child(1) {
  -webkit-transform :translateZ(100px);
  -moz-transform    :translateZ(100px);
  -o-transform      :translateZ(100px);
  -ms-transform     :translateZ(100px);
  transform         :translateZ(100px);
}

ul li:nth-child(2) {
  -webkit-transform :rotateY(90deg) translateZ(100px);
  -moz-transform    :rotateY(90deg) translateZ(100px);
  -o-transform      :rotateY(90deg) translateZ(100px);
  -ms-transform     :rotateY(90deg) translateZ(100px);
  transform         :rotateY(90deg) translateZ(100px);
}

ul li:nth-child(3) {
  -webkit-transform :rotateY(180deg) translateZ(100px);
  -moz-transform    :rotateY(180deg) translateZ(100px);
  -o-transform      :rotateY(180deg) translateZ(100px);
  -ms-transform     :rotateY(180deg) translateZ(100px);
  transform         :rotateY(180deg) translateZ(100px);
}

ul li:nth-child(4) {
  -webkit-transform :rotateY(-90deg) translateZ(100px);
  -moz-transform    :rotateY(-90deg) translateZ(100px);
  -o-transform      :rotateY(-90deg) translateZ(100px);
  -ms-transform     :rotateY(-90deg) translateZ(100px);
  transform         :rotateY(-90deg) translateZ(100px);
}

ul li:nth-child(5) {
  -webkit-transform :rotateX(-90deg) translateZ(100px) rotate(180deg);
  -moz-transform    :rotateX(-90deg) translateZ(100px) rotate(180deg);
  -o-transform      :rotateX(-90deg) translateZ(100px) rotate(180deg);
  -ms-transform     :rotateX(-90deg) translateZ(100px) rotate(180deg);
  transform         :rotateX(-90deg) translateZ(100px) rotate(180deg);
}

ul li:nth-child(6)  {
  -webkit-transform :rotateX(90deg) translateZ(100px);
  -moz-transform    :rotateX(90deg) translateZ(100px);
  -o-transform      :rotateX(90deg) translateZ(100px);
  -ms-transform     :rotateX(90deg) translateZ(100px);
  transform         :rotateX(90deg) translateZ(100px);
}

#linkage {
  position:fixed;
  top:145px;
  left:0px;
  background-color:#3d3d3d;
  color:#ffffff;
  text-decoration:none;
  padding:5px;
  width:10%;
}
            
          
!
            
              /*********************************************************************
*  #### 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="<ul>";b<f;)g+="<li>"+a[b]+"</li>",b++;k.innerHTML=g+"</ul>"}else t(a)}function q(a){return a.replace(/<b[^>]*>(.*?)<\/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<d;h++)k.test(g[h].className)&&b.push(g[h]);return b}function y(a){if(void 0!==a&&0<=a.innerHTML.indexOf("data-srcset"))return a=a.innerHTML.match(/data-srcset="([A-z0-9%_\.-]+)/i)[0],decodeURIComponent(a).split('"')[1]}var F="",f=20,H=!0,x=[],z=!1,A=!0,n=!0,B=null,C=!0,D=!0,t=null,I=!0,u=!1,v=!0,J=!0,K=!1,m=null,L={fetch:function(a){void 0===
a.maxTweets&&(a.maxTweets=20);void 0===a.enableLinks&&(a.enableLinks=!0);void 0===a.showUser&&(a.showUser=!0);void 0===a.showTime&&(a.showTime=!0);void 0===a.dateFunction&&(a.dateFunction="default");void 0===a.showRetweet&&(a.showRetweet=!0);void 0===a.customCallback&&(a.customCallback=null);void 0===a.showInteraction&&(a.showInteraction=!0);void 0===a.showImages&&(a.showImages=!1);void 0===a.linksInNewWindow&&(a.linksInNewWindow=!0);void 0===a.showPermalinks&&(a.showPermalinks=!0);void 0===a.dataOnly&&
(a.dataOnly=!1);if(z)x.push(a);else{z=!0;F=a.domId;f=a.maxTweets;H=a.enableLinks;n=a.showUser;A=a.showTime;D=a.showRetweet;B=a.dateFunction;t=a.customCallback;I=a.showInteraction;u=a.showImages;v=a.linksInNewWindow;J=a.showPermalinks;K=a.dataOnly;var l=document.getElementsByTagName("head")[0];null!==m&&l.removeChild(m);m=document.createElement("script");m.type="text/javascript";m.src=void 0!==a.list?"https://syndication.twitter.com/timeline/list?callback=twitterFetcher.callback&dnt=false&list_slug="+
a.list.listSlug+"&screen_name="+a.list.screenName+"&suppress_response_codes=true&lang="+(a.lang||"en")+"&rnd="+Math.random():void 0!==a.profile?"https://syndication.twitter.com/timeline/profile?callback=twitterFetcher.callback&dnt=false&screen_name="+a.profile.screenName+"&suppress_response_codes=true&lang="+(a.lang||"en")+"&rnd="+Math.random():void 0!==a.likes?"https://syndication.twitter.com/timeline/likes?callback=twitterFetcher.callback&dnt=false&screen_name="+a.likes.screenName+"&suppress_response_codes=true&lang="+
(a.lang||"en")+"&rnd="+Math.random():"https://cdn.syndication.twimg.com/widgets/timelines/"+a.id+"?&lang="+(a.lang||"en")+"&callback=twitterFetcher.callback&suppress_response_codes=true&rnd="+Math.random();l.appendChild(m)}},callback:function(a){function m(a){var b=a.getElementsByTagName("img")[0];b.src=b.getAttribute("data-src-2x");return a}a.body=a.body.replace(/(<img[^c]*class="Emoji[^>]*>)|(<img[^c]*class="u-block[^>]*>)/g,"");u||(a.body=a.body.replace(/(<img[^c]*class="NaturalImage-image[^>]*>|(<img[^c]*class="CroppedImage-image[^>]*>))/g,
""));n||(a.body=a.body.replace(/(<img[^c]*class="Avatar"[^>]*>)/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");e<b.length;){0<b[e].getElementsByClassName("timeline-Tweet-retweetCredit").length?d.push(!0):d.push(!1);if(!d[e]||d[e]&&D)a.push(b[e].getElementsByClassName("timeline-Tweet-text")[0]),r.push(b[e].getAttribute("data-tweet-id")),
n&&k.push(m(b[e].getElementsByClassName("timeline-Tweet-author")[0])),g.push(b[e].getElementsByClassName("dt-updated")[0]),p.push(b[e].getElementsByClassName("timeline-Tweet-timestamp")[0]),void 0!==b[e].getElementsByClassName("timeline-Tweet-media")[0]?h.push(b[e].getElementsByClassName("timeline-Tweet-media")[0]):h.push(void 0);e++}else for(b=l(b,"timeline-Tweet");e<b.length;){0<l(b[e],"timeline-Tweet-retweetCredit").length?d.push(!0):d.push(!1);if(!d[e]||d[e]&&D)a.push(l(b[e],"timeline-Tweet-text")[0]),
r.push(b[e].getAttribute("data-tweet-id")),n&&k.push(m(l(b[e],"timeline-Tweet-author")[0])),g.push(l(b[e],"dt-updated")[0]),p.push(l(b[e],"timeline-Tweet-timestamp")[0]),void 0!==l(b[e],"timeline-Tweet-media")[0]?h.push(l(b[e],"timeline-Tweet-media")[0]):h.push(void 0);e++}a.length>f&&(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<e;)b.push({tweet:a[c].innerHTML,author:k[c].innerHTML,
time:g[c].textContent,image:y(h[c]),rt:d[c],tid:r[c],permalinkURL:void 0===p[c]?"":p[c].href}),c++;else for(;c<e;){if("string"!==typeof B){var d=g[c].getAttribute("datetime"),w=new Date(g[c].getAttribute("datetime").replace(/-/g,"/").replace("T"," ").split("+")[0]),d=B(w,d);g[c].setAttribute("aria-label",d);if(a[c].textContent)if(C)g[c].textContent=d;else{var w=document.createElement("p"),t=document.createTextNode(d);w.appendChild(t);w.setAttribute("aria-label",d);g[c]=w}else g[c].textContent=d}d=
"";H?(v&&(G(a[c]),n&&G(k[c])),n&&(d+='<div class="user">'+q(k[c].innerHTML)+"</div>"),d+='<p class="tweet">'+q(a[c].innerHTML)+"</p>",A&&(d=J?d+('<p class="timePosted"><a href="'+p[c]+'">'+g[c].getAttribute("aria-label")+"</a></p>"):d+('<p class="timePosted">'+g[c].getAttribute("aria-label")+"</p>"))):(n&&(d+='<p class="user">'+k[c].textContent+"</p>"),d+='<p class="tweet">'+a[c].textContent+"</p>",A&&(d+='<p class="timePosted">'+g[c].textContent+"</p>"));I&&(d+='<p class="interact"><a href="https://twitter.com/intent/tweet?in_reply_to='+
r[c]+'" class="twitter_reply_icon"'+(v?' target="_blank">':">")+'Reply</a><a href="https://twitter.com/intent/retweet?tweet_id='+r[c]+'" class="twitter_retweet_icon"'+(v?' target="_blank">':">")+'Retweet</a><a href="https://twitter.com/intent/favorite?tweet_id='+r[c]+'" class="twitter_fav_icon"'+(v?' target="_blank">':">")+"Favorite</a></p>");u&&void 0!==h[c]&&void 0!==y(h[c])&&(d+='<div class="media"><img src="'+y(h[c])+'" alt="Image from tweet" /></div>');u?b.push(d):!u&&a[c].textContent.length&&
b.push(d);c++}E(b);z=!1;0<x.length&&(L.fetch(x[0]),x.splice(0,1))}};return window.twitterFetcher=L});


/*
* ### For instructions how to use my component please see original post at:
*     http://www.jasonmayes.com/projects/twitterApi/ : ###
*/

var config1 = {
  "id": '347099293930377217',
  "domId": 'example1',
  "maxTweets": 6,
  "enableLinks": true,
  "showUser": true,
  "showTime": true,
  "lang": 'en'
};

twitterFetcher.fetch(config1);

            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console