简体   繁体   中英

Twitter Feed API stopped working

Here is the following code I am using

<script src="http://widgets.twimg.com/j/2/widget.js"></script> 
    <script>
new TWTR.Widget({
  version: 2,
  type: 'profile',
  rpp: 4,
  interval: 3000,
  width: 'auto',
  height: 281,
  theme: {
    shell: {
      background: '#fff',
      color: '#3a589c'
    },
    tweets: {
      background: '#ffffff',
      color: '#000000',
      links: '#3a589c'
    }
  },
  features: { 
    scrollbar: false,
    loop: true,
    live: true,
    hashtags: true,
    timestamp: true,
    avatars: false,
    behavior: 'default'
  }
}).render().setUser(klatianstayahed).start();
</script> 

Where I am getting code error on http://widgets.twimg.com/j/2/widget.js follows.

TWTR=window.TWTR||{};(function(){var A=0;var D;var B=["init","setDimensions","setRpp","setFeatures","setTweetInterval","setBase","setList","setProfileImage","setTitle","setCaption","setFooterText","setTheme","byClass","render","removeEvents","clear","start","stop","pause","resume","destroy"];function C(H){var E=0;var G;var 

F=["The Twitter API v1.0 is deprecated, and this widget has ceased functioning.","You can replace it with a new, upgraded widget from ","For more information on alternative Twitter tools, see https://dev.twitter.com/docs/twitter-for-websites "];

if(!window.console){return }for(;G=F[E];E++){if(console.warn){console.warn("TWITTER WIDGET: "+G);continue}console.log(G)}}TWTR.Widget=function(E){switch(E.type){case"search":C("search?query="+escape(E.search));break;case"profile":this._profile=true;break;case"list":case"lists":C("list");break;default:return }};TWTR.Widget.ify={autoLink:function(){return{match:function(){return false}}}};TWTR.Widget.randomNumber=function(){};TWTR.Widget.prototype.isRunning=function(){return false};TWTR.Widget.prototype.setProfile=function(E){C("user?screen_name="+escape(E));return this};TWTR.Widget.prototype.setUser=function(E){if(this._profile){return this.setProfile(E)}C("favorites?screen_name="+escape(E));return this};TWTR.Widget.prototype.setSearch=function(E){C("search?query="+escape(E));return this};for(;D=B[A];A++){TWTR.Widget.prototype[D]=function(){return this}}})();

And I followed instruction from the URL

https://twitter.com/settings/widgets And https://dev.twitter.com/docs/embedded-timelines

But I am not getting the old look and many options got turned off like Auto scroll, I cant move Tweet from Header of that widget and put the Pic of the a/c on the twitter(It was on the old script I posted above). And most embarrasing thing is on below it is written Tweet to @klatianstayahed which I dislike the most and want to remove that option. Can any body help me to modify it and modify my old script as that old script will work, not the new one which is not I want. My requirement is to get the updated script of http://widgets.twimg.com/j/2/widget.js as it is obsoulate.

The new twitter API 1.1 uses a Oath plugin. So there is a PHP code which I got from Github and entered the keys i got by registering an application on twitter.

Then I used the JSON generated by the PHP and formatted it using jQuery using another javascript...

This is the solution I got from here

This is the way that you really want to go as this is the only way you can tweak the way the tweets are displayed on your websites. The widget that twitter provides is really basic and besides the basic color and size options, you cannot alter the tweets. Now the example I have provided is a PHP script which authorizes your website with twitter and gets the tweets for you. There are other libraries available for ASP.net,Java, Python which can be found HERE .

What you dont want to use is a client only side script like javascript as in the new API 1.1 we use the 4 authentication keys and if you use javascript as the Oath tool because you would be exposing these 4 keys

Twitter did a really bad Job on this! You cant get the old look, because Twitter dont want you to. The API V1 is gone and you have to use the new one. And using the new one, means use it like twitter wish to... dark, light! I had a time to find out, that you can set the background to transparent, so you have some page look to it... Shitstorm here: https://dev.twitter.com/discussions/10644

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM