分享时Twitter发生错误

时间:2013-08-27 11:55:08

标签: java android mysql twitter mobile-application

你能告诉我这个错误与...有关吗?我每次在将内容分享到Twitter时都会收到此错误....

08-27 17:13:50.966: D/error dj-->(2469): 403:The request is understood, but it has been refused. An accompanying error message will explain why. This code is used when requests are being denied due to update limits (http://support.twitter.com/forums/10711/entries/15364).
08-27 17:13:50.966: D/error dj-->(2469): <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
08-27 17:13:50.966: D/error dj-->(2469): <HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
08-27 17:13:50.966: D/error dj-->(2469): <TITLE>ERROR: The requested URL could not be retrieved</TITLE>
08-27 17:13:50.966: D/error dj-->(2469): <STYLE type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>
08-27 17:13:50.966: D/error dj-->(2469): <H1>ERROR</H1>
08-27 17:13:50.966: D/error dj-->(2469): <H2>The requested URL could not be retrieved</H2>
08-27 17:13:50.966: D/error dj-->(2469): <HR noshade size="1px">
08-27 17:13:50.966: D/error dj-->(2469): <P>
08-27 17:13:50.966: D/error dj-->(2469): While trying to retrieve the URL:
08-27 17:13:50.966: D/error dj-->(2469): <A HREF="http://api.twitter.com/1/statuses/update.json">http://api.twitter.com/1/statuses/update.json</A>
08-27 17:13:50.966: D/error dj-->(2469): <P>
08-27 17:13:50.966: D/error dj-->(2469): The following error was encountered:
08-27 17:13:50.966: D/error dj-->(2469): <UL>
08-27 17:13:50.966: D/error dj-->(2469): <LI>
08-27 17:13:50.966: D/error dj-->(2469): <STRONG>
08-27 17:13:50.966: D/error dj-->(2469): Access Denied.
08-27 17:13:50.966: D/error dj-->(2469): </STRONG>
08-27 17:13:50.966: D/error dj-->(2469): <P>
08-27 17:13:50.966: D/error dj-->(2469): Access control configuration prevents your request from
08-27 17:13:50.966: D/error dj-->(2469): being allowed at this time.  Please contact your service provider if
08-27 17:13:50.966: D/error dj-->(2469): you feel this is incorrect.
08-27 17:13:50.966: D/error dj-->(2469): </UL>
08-27 17:13:50.966: D/error dj-->(2469): <P>Your cache administrator is <A HREF="mailto:admin@localhost">admin@localhost</A>. 
08-27 17:13:50.966: D/error dj-->(2469): <BR clear="all">
08-27 17:13:50.966: D/error dj-->(2469): <HR noshade size="1px">
08-27 17:13:50.966: D/error dj-->(2469): <ADDRESS>
08-27 17:13:50.966: D/error dj-->(2469): Generated Tue, 27 Aug 2013 11:43:51 GMT by localhost (squid/2.7.STABLE9)
08-27 17:13:50.966: D/error dj-->(2469): </ADDRESS>
08-27 17:13:50.966: D/error dj-->(2469): </BODY></HTML>

2 个答案:

答案 0 :(得分:0)

您正在使用Twitter的弃用Web服务

http://api.twitter.com/1/statuses/update.json

这代表REST服务的第1版,但据我所知,Twitter更新为1.1。

您应该将twitter 4j库更改为3.0.3版

答案 1 :(得分:0)

尝试此示例,它对我TWITTER EXAMPLE起作用,并更改我们修改后的consumer_keysecret_key

public final String consumer_key = "Replace your KEY";
public final String secret_key = "Replace your KEY";

这个也很好Another Example

使用最新的库 twitter4j-media-support-3.0.3.jartwitter4j-core-3.0.3.jar