Re: [twitter-dev] Twitter status update through a Ajax Post

2010-02-12 Thread Raffi Krikorian
hi!

i see nothing obviously wrong with this - is this hosted somewhere so we can
hit it with a browser and see what's being generated by the browser request?

On Fri, Feb 12, 2010 at 1:37 AM, atomic mouse  wrote:

> Hello Friends;
>
> In December I wrote a little function to allow users to update our
> Twitter status by  completing a form embedded in our CMS. This has
> worked fine untill last week.
>
> The script simply sends a ajax post to "http://twitter.com/statuses/
> update.xml"
>
> Unfortunately it returns the following error:
>  Permission denied - line 13
>
> Which is the line stating :
>  axobj.open("POST",purl,false,"my username","my password");
>
> *The "my username" and "my password" is replaced with the correct
> login details at runtime.
>
> Here is the complete test code:
>
> <%...@language="JAVASCRIPT" CODEPAGE="1252"%>
> 
> 
>
> 
> function asp_twitter_update(strMsg)
> {
>
>var axobj,purl;
>
>purl = "http://twitter.com/statuses/update.xml";;
>
>axobj = new ActiveXObject("Microsoft.XMLHTTP");
>axobj.open("POST",purl,false,"UPTuks","brandewyn");
>axobj.setRequestHeader("Content-type", "application/x-www-form-
> urlencoded");
>//axobj.setRequestHeader("Connection", "close");
>
>axobj.send("status="+Server.URLEncode(strMsg));
>
> }
>
>asp_twitter_update("This is the new status message to be posted");
> 
> 
> 
>
> 
> 
> I have spent around 18 hours so far trying to solve this problem, but
> no luck so far.
>
> Any and all help in resolving this will be greatly appreciated.
>
> Regards
>



-- 
Raffi Krikorian
Twitter Platform Team
http://twitter.com/raffi


[twitter-dev] Twitter status update through a Ajax Post

2010-02-12 Thread atomic mouse
Hello Friends;

In December I wrote a little function to allow users to update our
Twitter status by  completing a form embedded in our CMS. This has
worked fine untill last week.

The script simply sends a ajax post to "http://twitter.com/statuses/
update.xml"

Unfortunately it returns the following error:
  Permission denied - line 13

Which is the line stating :
  axobj.open("POST",purl,false,"my username","my password");

*The "my username" and "my password" is replaced with the correct
login details at runtime.

Here is the complete test code:

<%...@language="JAVASCRIPT" CODEPAGE="1252"%>




function asp_twitter_update(strMsg)
{

var axobj,purl;

purl = "http://twitter.com/statuses/update.xml";;

axobj = new ActiveXObject("Microsoft.XMLHTTP");
axobj.open("POST",purl,false,"UPTuks","brandewyn");
axobj.setRequestHeader("Content-type", "application/x-www-form-
urlencoded");
//axobj.setRequestHeader("Connection", "close");

axobj.send("status="+Server.URLEncode(strMsg));

}

asp_twitter_update("This is the new status message to be posted");







Re: [twitter-dev] Twitter status update with Basic Auth Lua

2009-12-01 Thread Mark McBride
Correct on the headers... Also note that if you're making a post, you
don't want "status=..." in the query string, you want it added to the
body of the request.  Are you using a specific Lua HTTP library?

   ---Mark

On Tue, Dec 1, 2009 at 8:45 AM, Josh Roesslein  wrote:
> Your basic auth value should be in a header not the post body. The
> other X- values I think also go
> into headers, but I don't provide those really so not sure. I'm not
> even sure if twitter pays attention to those.
>
> Josh
>
> On Tue, Dec 1, 2009 at 9:25 AM, Prometheus3k  wrote:
>> Hi guys,
>> I'm using a desktop platform with a Lua scripting environment. The app
>> I'm making is standalone and does not run in a browser. It can connect
>> to http resources.
>> I'm trying out a simple test to update a status but web services isn't
>> a strong point of mine.
>>
>> I'm following Basic Auth for now and looking to implement OAuth later.
>> The problem I'm having seems to be waiting for the xml response from
>> https://twitter.com/statuses/update.xml
>>
>> I've url encoded my status message and am requesting a https resource
>> similar to
>> "https://twitter.com/statuses/update.xml?status="; .. url_encoded_msg
>>
>> I've created post data object setting type to "application/x-www-form-
>> urlencoded" and added the following key/values to the post data
>> Postdata.addValue("X-Twitter-Client", "me")
>> Postdata.addValue("X-Twitter-Client-Version", "1.0" )
>> Postdata.addValue("X-Twitter-Client-URL", "www.my_url.com")
>> and finally
>> Postdata.addValue( "Authorization", authValue)
>>
>> where authValue is the string "Basic " .. Base64.Encode
>> (username:password)
>>
>> I then send this off to twitter url
>> "https://twitter.com/statuses/update.xml?status="; .. url_encoded_msg
>> with the postdata.
>>
>> However my code ends up in a loop waiting for the xml response and
>> eventually timing out. I'd like to know if I've got the right steps
>> and values for PostData.
>>
>> thanks
>>
>



-- 
   ---Mark

http://twitter.com/mccv


Re: [twitter-dev] Twitter status update with Basic Auth Lua

2009-12-01 Thread Josh Roesslein
Your basic auth value should be in a header not the post body. The
other X- values I think also go
into headers, but I don't provide those really so not sure. I'm not
even sure if twitter pays attention to those.

Josh

On Tue, Dec 1, 2009 at 9:25 AM, Prometheus3k  wrote:
> Hi guys,
> I'm using a desktop platform with a Lua scripting environment. The app
> I'm making is standalone and does not run in a browser. It can connect
> to http resources.
> I'm trying out a simple test to update a status but web services isn't
> a strong point of mine.
>
> I'm following Basic Auth for now and looking to implement OAuth later.
> The problem I'm having seems to be waiting for the xml response from
> https://twitter.com/statuses/update.xml
>
> I've url encoded my status message and am requesting a https resource
> similar to
> "https://twitter.com/statuses/update.xml?status="; .. url_encoded_msg
>
> I've created post data object setting type to "application/x-www-form-
> urlencoded" and added the following key/values to the post data
> Postdata.addValue("X-Twitter-Client", "me")
> Postdata.addValue("X-Twitter-Client-Version", "1.0" )
> Postdata.addValue("X-Twitter-Client-URL", "www.my_url.com")
> and finally
> Postdata.addValue( "Authorization", authValue)
>
> where authValue is the string "Basic " .. Base64.Encode
> (username:password)
>
> I then send this off to twitter url
> "https://twitter.com/statuses/update.xml?status="; .. url_encoded_msg
> with the postdata.
>
> However my code ends up in a loop waiting for the xml response and
> eventually timing out. I'd like to know if I've got the right steps
> and values for PostData.
>
> thanks
>


[twitter-dev] Twitter status update with Basic Auth Lua

2009-12-01 Thread Prometheus3k
Hi guys,
I'm using a desktop platform with a Lua scripting environment. The app
I'm making is standalone and does not run in a browser. It can connect
to http resources.
I'm trying out a simple test to update a status but web services isn't
a strong point of mine.

I'm following Basic Auth for now and looking to implement OAuth later.
The problem I'm having seems to be waiting for the xml response from
https://twitter.com/statuses/update.xml

I've url encoded my status message and am requesting a https resource
similar to
"https://twitter.com/statuses/update.xml?status="; .. url_encoded_msg

I've created post data object setting type to "application/x-www-form-
urlencoded" and added the following key/values to the post data
Postdata.addValue("X-Twitter-Client", "me")
Postdata.addValue("X-Twitter-Client-Version", "1.0" )
Postdata.addValue("X-Twitter-Client-URL", "www.my_url.com")
and finally
Postdata.addValue( "Authorization", authValue)

where authValue is the string "Basic " .. Base64.Encode
(username:password)

I then send this off to twitter url
"https://twitter.com/statuses/update.xml?status="; .. url_encoded_msg
with the postdata.

However my code ends up in a loop waiting for the xml response and
eventually timing out. I'd like to know if I've got the right steps
and values for PostData.

thanks


[twitter-dev] twitter status update

2009-11-26 Thread nite21
hi all
how to do status updates using twitter api with flash

will someone help me in this

thansk