Coldfusion Twitter status posting help

19 views
Skip to first unread message

Craig328

unread,
Mar 29, 2009, 2:32:28 PM3/29/09
to Twitter Development Talk
I've been banging my head on this issue for the past 3-4 days to the
point that my skull has attained a soggy, squishy quality...so any
help would be most appreciated.

I have a Twitter account that I want to post simple periodic updates
to from a website I own. I can successfully do this:

<cfhttp url="http://twitter.com/account/verify_credentials.xml"
method="get" username="#variables.Tusername#"
password="#variables.Tpassword#">

That works everytime. However, this does not work:

<cfhttp url="http://twitter.com/statuses/update.xml" method="POST"
username="#variables.Tusername#" password="#variables.Tpassword#"
charset="UTF-8">
<cfhttpparam type="FORMFIELD" name="user"
value="#variables.Tusername#">
<cfhttpparam type="FORMFIELD" name="password"
value="#variables.Tpassword#">
<cfhttpparam type="FORMFIELD" name="status"
value="#variables.Tstatus#">
</cfhttp>

Not just that but any variation of the post to update.xml fails and
the fail reason is: "Could not authenticate you." I've tried it in
just about every combination I can think of. I've scoured Twitter's
API docs, Google and everywhere in between and can't get this to go.
I'm hoping someone can point me in the right direction. This seems a
really simply thing but it's driving me to distraction. I don't
believe there's a setting in Twitter itself that is causing the
issue...but perhaps I'm wrong.

Any help/assistance would be most welcome and appreciated. Thanks in
advance.

Matt Sanford

unread,
Mar 30, 2009, 10:41:58 AM3/30/09
to twitter-deve...@googlegroups.com
Hi there,

    I don't know CF, but it looks like you're passing username and password as form fields. You need to use HTTP Basic authentication and only pass in status as a parameter.

Thanks;
  — Matt Sanford / @mzsanford

Craig328

unread,
Mar 30, 2009, 3:35:59 PM3/30/09
to Twitter Development Talk
Fair enough. I did see the basic authentication mention in the wiki
guide. I can parse together the "username:password" and put it into
base64...I just don't know how to pass that to Twitter. Do you know
where I can find an example online? I've looked and found examples
like I posted above that seem to work for others...just not working
for me it seems.

I wonder if there's an issue with odd characters being in the
password? I have a single character that's not alphanumeric...I
wonder if that could be it?

Abava

unread,
Mar 30, 2009, 4:04:16 PM3/30/09
to Twitter Development Talk
check out this JSP taglib:
http://www.servletsuite.com/servlets/twittertag.htm

you can use it in CF as well

Craig328

unread,
Mar 30, 2009, 7:08:27 PM3/30/09
to Twitter Development Talk
Abava, thanks. Unfortunately, the CFML engine I'm using runs on .NET
so I can't use the JSP stuff without a lot of wrappers and such.
Reply all
Reply to author
Forward
0 new messages