Question

Is it possible to get the tweets of a user and follow a user using my development environment, I mean using localhost. I got the code from twitter to get the tweets of a user and to follow that user. here is what I have tried

<div class="span4 offset5 top_twitter">
   <span class="tweet query" id="ticker">
      <a class="twitter-timeline" href="https://twitter.com/wearybands/favorites" data-widget-id="407316719342870528">Tweets by wearybands</a>
   </span>
   <span class="icon-twitter">
      <a href="https://twitter.com/wearybands" class="twitter-follow-button" data-show-count="false" data-lang="en">Follow Us</a>
   </span>
</div> 

The javascript for both of them is

  <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
  <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>

I neither get the tweets of the user nor I am able to follow the user

Was it helpful?

Solution

Yes you can test this locally. The widget ID you are trying to use is linked to wearyband/favorites. This twitter user does not have any favorites, hence an empty timeline. Try creating a new widget ID that is associated to your main timeline.

Replace

<a class="twitter-timeline" href="https://twitter.com/wearybands/favorites" data-widget-id="407316719342870528">Tweets by wearybands</a>

With

<a class="twitter-timeline" href="https://twitter.com/wearybands" data-widget-id="408647058245971968">Tweets by @wearybands</a>

OTHER TIPS

Follow @asa1122e

function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top