Post directly to twitter and youtube - php

I am thinking of adding a feature to my website that allows me to write a post or add a video on my site and also post it to my twitter and/or youtube accounts with the click of a button. Does anyone know if there is a way to do this? I am not looking for code, just some links to documentation on how this is done.
Thanks.

Yes, there is. You have to connect with twitter and youtube, and you do it by using their API (Aplication Programming Interface). You register in their developers site and get a secret API key (kind of a password to allow you to use the API). Then, you just call their functions.

Twitter API: https://dev.twitter.com/
Youtube API: http://code.google.com/apis/youtube/overview.html
On these pages you will find code examples, libraries etc. which should be sufficient for you.

Related

How to know if someone is fan of my facebook page?

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.

Getting Twitter followers images with 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.

How to Post to My Facebook Fan Page using PHP and Graph API?

i like to post to my FB Fan Page, Some Content using cron job in PHP,How can i do that?
Can you gave me example?
After becoming familiar with the Graph API check out Facebook's documentation for Pages
http://developers.facebook.com/docs/reference/api/page/
Here is the main page for Facebook's Graph API documentation
http://developers.facebook.com/docs/api
For PHP Development, check out this SDK, It will make your life much easier for interacting with Facebook using PHP
https://github.com/facebook/php-sdk/
Here is a link for how to configure your Facebook APP to be able to post on a Facebook Page
http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/
(I did not follow this exact tutorial but slaved to figure it out myself, so let me know how it works for you)
note As I mentioned in a below comment make special note of the permanent session key.

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.

Get Twitter User Details without Authentication

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.

Categories