1

Does anyone know how to post automatically on twitter like Facebook has...

In facebook, there is API/SDK that allows PHP to post status to visitors wall if they allow my application to do that, but what about twitter? I know that it's possible, but I don't know how...

I found 2 ways online to post with twitter with PHP script BUT:


  1. Request me to insert my username/password ( which I think users won't insert )

  2. Use my customer ID/secret found on application page, but then it post to my twitter, not to visitors


Is there any way to post to twitter using PHP but for my visitors on site, not for myself?

Something like allowing application to post instead of them like facebook has...

Can someone help me with that?

Sathyajith Bhat
  • 21,321
  • 22
  • 95
  • 134
SharkTheDark
  • 3,089
  • 4
  • 24
  • 29
  • Hi, i was looking for a solution so that other user can post on my twitter page without the user required to logging into to twitter i.e, automatically user will be allowed to post on my twitter. If i have not misunderstood, you have sample code/reference which can do so(mentioned at point #2). Can you help me on this? – Debashis Sep 11 '12 at 12:43

1 Answers1

5

You need to have the user authenticated using oAuth, and then store their credentials in a DB and use that to post the status updates.

ahoura
  • 689
  • 1
  • 6
  • 16
  • So if users want to share messages sent to my site on twitter too they need to insert twitter username/password first, so I can save it to DB and then fetching that to connect and post to their twitter? No other way? – SharkTheDark Sep 29 '11 at 23:59
  • no, you need to use twitter's oAuth (twitter connect if you will) to allow the user to connect to your site, then twitter sends you back a string with user's credentials (by credentials I dont mean username and password, its something similar to the customer ID/secret) you get that allows you to do stuff on behalf of the user ( follow, msg, unfollow, update status etc). – ahoura Sep 30 '11 at 00:03
  • I found something about this now... Omg, can they make it more complicated... :S Thank you for your help, btw ;) – SharkTheDark Sep 30 '11 at 00:10
  • np :) ... if it was helpful then voteup or choose my answer. thanks – ahoura Sep 30 '11 at 00:18
  • I was expecting some code samples, but it's okay, I voted anyhow ;) – SharkTheDark Sep 30 '11 at 00:19
  • well thanks, but I didnt know that, otherwise I would have pointed you to a site for the code, because its not possible to put the entire code in here – ahoura Sep 30 '11 at 00:22
  • It's okay, I found out that I had it all the time with SDK I downloaded, just I didn't know what part of it I needed... Thank you for resolving my dilemma about other ways to do it :) ;) – SharkTheDark Sep 30 '11 at 00:25