Twitter API or Library to remember the session - php

I've been going through the Twitter API, but they are not as friendly as Facebook. My requirement is remember the authentication in the server / db and post user messages to the timeline without invoking twitter UI. Ofcourse I know we need to allow first time authentication via Twitter UI.
I'm not sure where to start and 2 days of Google search didn't end at any place where I can get started. Is there any document, resources, library (PHP or JavaScript) available to execute such scenario?
Thanks in advance.

This is a wonderful tutorial on how to auto post via PHP to Twitter. Check it out

Related

Add users post to their facebook newsfeed automtically with php

I have a website I'm working on. It enables users to register and post stuffs within the site. Can I get a link to some sort of api that allows people to add their facebook account (once) and then automatically post what they posted on my site on their facebook newsfeed (the sort of thing that happens when you connect your facebook account to your twitter account) .I've searched and can't seem to get exactly what I want
What you want is pretty common and if you searched you clearly didn't do a good job on the search.
Using the Facebook PHP SDK is pretty straight forward. There is a PHP Library available with a demo of the functionality you want. In your case you need to do some stuff more, so I'll explain globally what you should do:
Get the Facebook PHP SDK and load it into your website, determine what scope you need to perform the actions what you are going to do, in your case you need to have access to their timeline which is called the publish_stream scope. In order to get the Facebook PHP SDK working you need to create an app at http://developers.facebook.com
If a user grants access you need to save the authentication token that the user provides and save it in your database for later use. I'm not 100% sure how long they are valid, I think it's maximum of 30 days at the moment, but you have the ability to refresh the toking in the requests you make (correct me if I'm wrong, it's been a while..)
Everytime an action is done using the Facebook API you inject the usertoken in the request, thus performing the "post" action onto their timeline.
What you are looking for is pretty straight forward and easy to find..

How to use PHP and Twitter to reward users when they send a tweet using your application?

I've never made an application on twitter before. But when I do I want to use PHP and Twitter to award users when they send a tweet using my application.
So for example.
User clicks on "Tweet for bonus insert_stuff_here" link.
User then allows app to use they're twitter.
~Tweet gets posted~
PHP detects that <-- somehow?
You want to look at the twitter API then when you post the users tweet on their behalf you can run your code at the same time to award a bonus.
you will need to create a twitter application and create a oAuth key.
https://dev.twitter.com/docs/api/1/post/statuses/update
https://dev.twitter.com/docs/api
People here aren't going to write a whole script for you when you haven't even attempted it yourself... i would suggest you do some research attempt some code, and if you get stuck then post what you have so far :-)

YQL + PHP : how to make a facebook login

I was reading some stuff about the YQL api that Yahoo! has provided, I am not sure, but it appears to be a collection of lots of third party api into one common language, right?
what I don't get is how to make the facebook login through it so I can get the user profile data...
My project is to add a facebook(and other social networks) form login, because the website won't have his own login, people will have to use a social network to link in. Then I thought the YQL would help me out with this task so I wouldn't have to develop lots of functions to each one of the networks.
Reading this http://developer.yahoo.com/yql/guide/yql-code-examples.html#sdk_yql, I understood how to make a Yahoo login so I can access some private data, but couldn't find how I could do it with facebook and others
So my question... Can YQL help me with this? Can you give me a simple example of a facebook session using it within PHP? Are there alternatives to aid me in this task?
thanks,
Jonathan
Yes , using YQL you will be able to do this task .. you can look at this demo http://demo.tutorialzine.com/2010/05/showing-facebook-twitter-rss-stats-jquery-yql/demo.html. Also if you are going to only use Facebook authentication , then there is no need for YQL you can do it using http://developers.facebook.com/docs/authentication/
I highly doubt that YQL has an API that gives a free hand with facebook login. You have to consider how a login works. You send POST data to a web server containing client-side password hashes and encryptions, as well as other kinds of identification. YQL has no way to "standardize" logins - it would have to make a new API for every popular web site.

how can I fetch private tweets using a PHP application

I want to show my latest tweet in a web page. My tweets are private for some reason and I should login to Twitter. I know that the basic HTTP authentication was deprecated in August 2010. How can I provide authentication in my PHP code to fetch private tweets (or userTimeline if I'm not mistaken)?
I've searched but unfortunately didn't find anything useful! :( Thanks in advance for your help!
Jan, I heard about ZendFramework while I was searching for the answer but It's complicated for me.
I found the solution here that illustrates how I can use OAuth based on Abraham’s Twitter OAuth library.
The key note is that I stored my 'oauth_access_token' in a database or somewhere else immediately after first login via my twitter credential. Then I remove the code which allow users to login to twitter and reuse stored credential to fetch the latest tweet by using $user->status->text variable.
It's a geeky job. It maybe has some potential security flaws but I'm not sure! ;)
By the way, Thanks a lot for your reply, Jan! :D
Authentication to Twitter is done via OAuth. A pretty simple way to access your Twitter account with PHP is using the latest version of ZendFramework. It will be required to register your app on twitter, which allows you to generate an oauth token. This token can be used to access your private twitter feed.
See documentation of Zend_Service_Twitter and Zend_Oauth_Consumer.
Here http://framework.zend.com/manual/en/zend.oauth.introduction.html you will find a pretty good introduction of using Zend OAuth together with twitter (note that the address used in the $config array has to be api.twitter.com/oauth and NOT twitter.com/oauth )
However, you can also make your Tweets public in your twitter account settings (Settings -> Account -> Tweet Privacy -> Uncheck "Protect my tweets"). Then your tweets will be available on the public timeline (not at once, you may have to wait a bit).
Hope that helps!
-Jan

How to set up a database and API web page to accept POST updates from iPhone?

I am developing an iPhone app, which now can update Twitter account with GPS coordinates in real-time, by the Twitter API link: http://username:password#twitter.com/statuses/update.xml , and I am looking at how to make my own database to accept updates from iPhone, via a similar API page.
It seems a .php page can serve as the API, and MySQL can serve as the database.
What are the good ways of doing it? Any template code and tutorial please?
Try one of these:
http://www.webresourcesdepot.com/how-to-create-an-api-10-tutorials/
Thanks for the answer. I found the php page just need code like
$userid=$_POST["userid"];
$companyid=$_POST["companyid"];
$phoneid=$_POST["phoneid"];
to receive POST from the iphone app.

Categories