5
我正在尝试发布到twitter。我已经认证了应用程序,现在想要发布更新。Twitter,oauth和coldfusion
这是我的HTTP POST是什么:
<cfhttp url="http://api.twitter.com/1/statuses/update.json" method="post">
<cfhttpparam type="header" name="status" value="#urlEncodedFormat('my test post')#" />
<cfhttpparam type="header" name="oauth_consumer_key" value="xxx" />
<cfhttpparam type="header" name="oauth_nonce" value="xxx" />
<cfhttpparam type="header" name="oauth_signature_method" value="#urlEncodedFormat('HMAC-SHA1')#" />
<cfhttpparam type="header" name="oauth_token" value="xxx" />
<cfhttpparam type="header" name="oauth_timestamp" value="#GetTickCount()#" />
<cfhttpparam type="header" name="oauth_version" value="1.0" />
</cfhttp>
有没有人这样做呢?我会走正确的路线吗?
的GetTickCount()返回以毫秒为单位,api需要秒,所以不要忘记div 1000. – Henry 2010-06-21 02:46:15
有人已经写了一个CFC供Twitter使用。你看过那个吗? http://twittercomponent.riaforge.org/ – ale 2010-06-21 18:12:01
Andy不是提供解决方案,而是观察:上面的代码显示了#urlEncodedFormat('HMAC-SHA1')#的使用,但这似乎表明存在误解。该函数的arg是一个要格式化的URL,虽然它需要第二个参数来表示一个charest,但这不是一个有效的。希望可能的解决方案的其他指针有所帮助。你有没有解决的事情? – 2011-11-14 16:39:43