简体   繁体   English

Twitter Feed API停止工作

[英]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. 我在http://widgets.twimg.com/j/2/widget.js上遇到代码错误的地方如下。

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 "]; F = [“Twitter API v1.0已弃用,此小部件已停止运行。”,“您可以将其替换为新的,已升级的小部件”,“有关其他Twitter工具的更多信息,请参阅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 我按照URL的说明进行操作

https://twitter.com/settings/widgets And https://dev.twitter.com/docs/embedded-timelines https://twitter.com/settings/widgetshttps://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. 大多数令人尴尬的事情都在下面,它写的是Tweet到@klatianstayahed,我最不喜欢并希望删除该选项。 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. 我的要求是获取http://widgets.twimg.com/j/2/widget.js的更新脚本,因为它是无形的。

The new twitter API 1.1 uses a Oath plugin. 新的twitter API 1.1使用Oath插件。 So there is a PHP code which I got from Github and entered the keys i got by registering an application on twitter. 因此,我从Github获得了一个PHP代码,并通过在twitter上注册应用程序输入了我获得的密钥。

Then I used the JSON generated by the PHP and formatted it using jQuery using another javascript... 然后我使用PHP生成的JSON,并使用jQuery使用另一个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. twitter提供的小部件非常基本,除了基​​本的颜色和大小选项外,您无法更改推文。 Now the example I have provided is a PHP script which authorizes your website with twitter and gets the tweets for you. 现在我提供的示例是一个PHP脚本,它使用twitter授权您的网站,并为您获取推文。 There are other libraries available for ASP.net,Java, Python which can be found HERE . 还有其他可用于ASP.net,Java,Python的库,可以在这里找到。

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 你不想使用的是像javascript一样的客户端脚本,就像在新的API 1.1中我们使用4个身份验证密钥,如果你使用javascript作为誓言工具,因为你将公开这4个密钥

Twitter did a really bad Job on this! Twitter对此做了一个非常糟糕的工作! You cant get the old look, because Twitter dont want you to. 你不能得到旧的外观,因为Twitter不要你。 The API V1 is gone and you have to use the new one. API V1消失了,你必须使用新的。 And using the new one, means use it like twitter wish to... dark, light! 并使用新的,意味着使用它像Twitter希望...黑暗,轻盈! 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 我有时间发现,你可以将背景设置为透明,所以你有一些页面看起来...在这里Shitstorm: https ://dev.twitter.com/discussions/10644

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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