Page 1 of 1

Scripting Twitter using cURL in Linux Rate Topic: -----

#1 Huzi94  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 14
  • View blog
  • Posts: 119
  • Joined: 14-November 09

Posted 17 April 2010 - 02:08 AM

Hello,
This is a simple tutorial which is going to teach you how to update your twitter status using cURL.

What us cURL?
cURL is a command line utility which is used to transfer data using URL syntax, supporting FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS, FILE, IMAP, SMTP, POP3 and RTSP.
cURL is availabe mostly on all Linux distros but you can download a binary package from cURL's download page if you don't have it installed.

Scripting status update
Below is a simple snippet which uses Twitter API to update your twitter status:
curl --basic --user username:password --data status="Dreamincode rocks" http://twitter.com/statuses/update.xml

To use this snippet open the Terminal and paste the above code using your own twitter username and password.
You can even change the status if you wish.

Explaining the snippet
--basic --user username:password

The above piece of code will authenticate your Twitter username and password. The API is password protected so it requires your Twitter username and password.

--data status="Dreamincode rocks"

The above piece of code will send the data to the API i.e your new status which will be in the form of POST HTTP request.

http://twitter.com/statuses/update.xml

The main part of the code which is the URL OF THE Twitter API.

Thats all for scripting status update of Twitter. Hope you enjoyed the tutorial.

Is This A Good Question/Topic? 0
  • +

Replies To: Scripting Twitter using cURL in Linux

#2 gungorbasa  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 26
  • Joined: 25-October 09

Posted 15 May 2010 - 04:35 AM

I have a proble with this script. When I write on command line that code its ok but I am trying to develop a twitter Java application. I write the same code but it does not work on right way. It takes until first space character.

ex:
curl --basic --user username:password --data status="Dreamincode rocks" http://twitter.com/statuses/update.xml



it takes just Dreamincode
Was This Post Helpful? 0
  • +
  • -

#3 desirocks  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 12-June 09

Posted 29 September 2010 - 06:42 PM

I am getting the below error.

$ curl --basic --user username:password --data status="Updating the status through curl" http://twitter.com/statuses/update.xml
<?xml version="1.0" encoding="UTF-8"?>
<errors>
<error code="53">Basic authentication is not supported</error>
</errors>
Was This Post Helpful? 0
  • +
  • -

#4 Huzi94  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 14
  • View blog
  • Posts: 119
  • Joined: 14-November 09

Posted 21 November 2010 - 12:51 AM

View Postdesirocks, on 30 September 2010 - 03:42 AM, said:

I am getting the below error.

$ curl --basic --user username:password --data status="Updating the status through curl" http://twitter.com/statuses/update.xml
<?xml version="1.0" encoding="UTF-8"?>
<errors>
<error code="53">Basic authentication is not supported</error>
</errors>


Sorry, the message means that twitter no longer supports basic authentication meaning the only way to post twitter updates is through a twitter application.
Was This Post Helpful? 1
  • +
  • -

#5 no2pencil  Icon User is offline

  • Toubabo Koomi
  • member icon

Reputation: 5224
  • View blog
  • Posts: 26,990
  • Joined: 10-May 07

Posted 21 November 2010 - 01:02 AM

That's exactly right. As per Twitter they no longer support Basic logins & require OAuth.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1