I have noticed some Twitter Applications manage to get a particular users Location, Name, Profile Image etc using just the twitter username?
Hows is this possible?
I ask because I have not come across any where in the Twitter docs on how you can do this. I can get a users details myself using oAuth when the user provides my app permission but thats it.
Would be grateful if this could be cleared. I hope its not the use of CURL as this is not a good idea in my eyes. If there is another way, is there a PHP implementation that I could use.
Thank you for any help.
Update
I did not know that existed! Is there a PHP wrapper or class someone has written to use that ? Sorry, I am complete noob and I relay on wrappers and simple function calls!
It's returned by the users/show call from the API.
For example:
http://twitter.com/users/show.xml?screen_name=dougw
The API wiki lists a PHP library FWIW.
Related
I know this subject has been done already over and over. but... i must be stupid so i'll try to figure out my problem simply.
I have a facebook page, let s say that one :
http://www.facebook.com/pages/Medieval-Forgecom/302734029745018
with a few fan poeple.
now on my website i would like to give a discount to poeple who are fan of that page.
So i tried the php api (with an application id and secret) before discovering that this is NOT what i want as my page is not an app and has no appId neither secret. Am i misunderstanding something here?
So i m wondering how in php i can know if someone is fan or not...
If it is not possible i could use the javascript api to make this check ( wich is quite bad, it should be done somewhere via php) but even this way i get trouble with the deprecated api and the code refering to javascript inside the facebook website.
in a nutshell, i'm lost.
thanks for your time and attention.
Do some research on the concept of "fan-gate". I think this is what you're looking for.
https://www.facebook.com/note.php?note_id=10150130919053430
http://www.youtube.com/watch?v=fBBnrtG0hAw
There are three ways of using Facebook API. Social plugins are widgets such as comments or like buttons. You can put them into your site directly and easily. And then there is the Graph API. First way of using this API is to create a whole standalone Facebook application, such as Farmwille. Second way is to use it only at your site, out of the Facebook frame. Regardless of the type of your usage, you need to register an application on Facebook, so Facebook API can authorize you. Without that you can't use the API. You don't need to create a real standalone app if you want only to use the API at your own site, but you must register it and this registration is just called Facebook application. It can be virtual application representing your site.
I am trying to get a list of all Google Apps users of a domain onto a public PHP website (without visitors of the site needing to login or do anything). I have a basic understanding of what needs to happen but can't quite piece it all together. It can't be as hard as it seems to me... could it?
Authentication and Authorization:
I'm pretty sure it needs to use OAuth 2.0 ... but am unsure whether it needs 2 legged or 3 legged. I got another section of the site working with ClientLogin but that won't pull in Google Apps profiles, only user's first and last names (I need the other profile fields). I have set up the API access within the account and have that side of things all set (I believe).
I have found this page, which shows how to construct a URL request to get all Profiles (in every language except PHP of course) but don't understand how to implement this.
http://code.google.com/googleapps/domain/profiles/developers_guide.html
I also tried this example but it just gives me a 401 after I enter the credentials. http://gdatatips.blogspot.com/2008/11/2-legged-oauth-in-php.html
I don't know which frameworks or includes are needed to accomplish this either. I have tried zend, OAuth.php and a whole bunch of other bootstraps... but keep getting lost as to what each is doing.
If someone could help me by outlining:
Which files/framework I need to upload and include as a bootstrap
What variables within those files I need to update with the Google credentials
How I integrate the Google Profiles "Retrieve all Profiles" request with PHP
An ELI5 (explain it like i'm 5) overview would be very much appreciated... I'm sorry for my apparent incompetence, but I have been reading articles for nearly a week and have not gotten anywhere.
Thank you in advance for any help provided.
Good question.
You'll need to implement the Google OAuth 2.0 process as it's described here (experimental?), because someone (you) will need to give your app the initial permissions to access Google Apps API. Steps are:
Register your domain with google (don't remember the link)
Redirect/send browser to an authentication url: https://accounts.google.com/o/oauth2/auth, with the appropriate request params (see the first link). You'll need access_type=offline, your scope would be https://apps-apis.google.com/a/feeds/user/
Get a code back, then exchange for a refresh_token, an access_token, and a value specifying when the access_token will expire. Store these in a database
Whenever you need to make an API call, check if your access_token has expired or not, and refresh when necessary, which is what the refresh_token is for. The refresh_token is valid as long as you don't revoke the access you gave to the app.
OAuth Playground helps a lot. Good luck.
I'm trying to find a service/script that allow me to add login to Facebook, twitter, google... in one solution: i have tried Hibridauth but it doesn't work at least for me, i don't find tutorial for Facebook and openid and i don't want to use paid service or free but limited ones.
Do you know something good?
I've heard good things about Zend_Oauth
Check this Links you may find a solution
PHP OpenID Library that allows facebook
Getting Started with OpenID and PHP
Open id and facebook implementation in php
I am not sure about it but i have read this in a comment on a blog The comment is "Check out NinjAuth which is currently a Fuel package. You can find the repo here https://github.com/philsturgeon/fuel-ninjauth and description here http://philsturgeon.co.uk/blog/2011/09/ninjauth-social-integration-php"
I am totally new to the twitter API, and I am trying to get all of my followers images to display them on my site, but the documentation on twitter.com has just confused me even more.
I am using PHP, and as far as I can tell I need to register an application, get a library that is suited to my needs, and them proceed to create my application.
The only problem with that is that I have no idea how to authenticate using OAuth, if anyone could shine some light on this matter, post a code snippit of how I can get all of the followers pics or maybe even point me to some useful tutorials or resources, that would be a great help.
Thanx in advance!
Everything you need to know is at the official Twitter API Docs at http://dev.twitter.com/doc
Like you already pointed out, you are supposed to get a library for interfacing with the Twitter API. These libraries usually have means to authenticate via OAuth as well, for instance you can use Zend Framework's Zend_OAuth component to authenticate and then use the access token to talk to the Twitter API with Zend_Service_Twitter.
i am working on a project in php.
When we post something on twitter, i want to grab the users who have re-tweeted my tweet and store it in my database. I want to work in php and mysql.
If I post a question on my tweet, i want grab the answers and save the userinfo of all the users who gave the right answer.
Any suggestions on how to get started?? Thanks :)
Here is a full twitter API class that someone has built that might be useful as well.
http://brandontreb.com/the-only-twitter-api-php-class-you-will-ever-need/
UPDATED:
Here is a RESTful API service for pulling retweets of your items:
http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses-retweets
You can use a pre-existing class or build your own. It will most likely require cURL and XML knowledge. But if you understand PHP, you should be able to knock this out fairly quick.