How to update twitter profile header image using the twitter API? - php

Twitter has launched new profile design
there is a big header image like facebook cover image
what i want to know is if there is any way i can update user's header image using twitter api??

If you look at the Network log while updating your header image in your Twitter account, you will see a call to 'upload_profile_header' went saving the new header image.
Look at the request payload to get the parameters needed.
authenticity_token=...&fileData=...&fileName=...&height=260&offsetLeft=0&offsetTop=0&uploadType=header&width=520.
Theoretically if you were gonna POST to account/upload_profile_header with all the parameters listed above this should be working.
I haven't tested this concept yet and it is just my suggestion.
Let me know how it went

There doesn't seem to be from looking at the API documentation, no: https://dev.twitter.com/docs/api/1.1#112
It wouldn't surprise me if they don't either. Facebook don't allow third-party apps to set cover photos as it can lead to apps essentially "hijacking" user profiles for their own promotion gain.

Related

how to post on google plus page stream using php/curl?

I want to post on google plus page stream using php, I checked google plus api but didn't found anything, read a post where it was saying that you can't post because google only provided read permission. When I googled I saw nextscripts SANP API to post on social networks.
If google only provided read permissions then how nextscripts is able to post?
SNAP is a paid API & I want to create my own code to do the same.
Is there anything I am missing. please guide me.
Short answer: There is no way to create a post that appears in a Google+ stream.
Medium answer: Google doesn't provide an API to post to a "normal" user's page. There are APIs that allow a website to let a user post something, and they can suggest text to post, but the user must take an explicit action. There have been attempts to use unauthorized APIs to do this, but they try to intercept the above procedure and aren't reliable. Depending on your exact needs, there are other alternatives as well.
Long answer: Depending on your exact needs, there may be some APIs which can help. But keep in mind they only apply to specific, sometimes very narrow, circumstances:
Are you trying to post to a page, not a user? There is the Google+ Page API which is available to partners only. This may be what the netxtscripts SNAP API is using - I don't know. This is what HootSuite uses, for example. You can request access at https://developers.google.com/+/api/pages-signup, but they don't approve many applicants.
Are you trying to post on behalf of a Google Apps user for other users in the same domain to see? If so, there is the Domains API at https://developers.google.com/+/domains/
Are trying to post an activity or action? Like the user listening to a song or eating at a restaurant? You may benefit from App Activities with the Moments API. These don't go directly into the stream, but are available through Search, in the user's profile in some limited ways, and they can reshare them into the stream if they wish. https://developers.google.com/+/features/app-activities
Let a user post to their stream from a web page? This still requires specific action by the user, so they have to approve what you're saying, but you can use something like normal share, +1, or interactive post buttons. https://developers.google.com/+/features/interactive-posts
You just want your server to post a plain old normal message to a normal user's stream without a person having to do anything? You can't do that.
There is still no way to post on a Google+ stream using an API. For details on what you can currently do with the limited API you can look at Google+ api
There is an issue request for this from as far back as 2011: Write access to the streams

PHP - Possible to automatically change MY profile pciture? Cover Photo?

Curious if the PHP Facebook SDK allows me to change only my own profile picture and cover photo. From the reading I've done I'm thinking no, but I wasn't able to find any recent, direct articles.
Any help is appreciated.
Looks like you can't actually change it, but you can get half way!
Setting Facebook Cover Photo via API
"ThereĀ“s no API support for changing user profile cover, but you can upload a photo and then redirect user to: http://www.facebook.com/profile.php?preview_cover=PHOTO_ID"

Twitter widget for timeline view with o_auth request(Rate limiting API) using PHP

I am using twitter widget for my site. This is the current js file I am using. I am facing the request time out issue for requests more than 150, which is due to the rate limiting API for unauthenticated requests as per the documentation.
Now I tried to go through the documentation to find how can I send an authenticated request i.e I will have to add an o_auth parameter, but was not successful. How can I achive it?
I also want to know if there exists a widget using which I can change the color of the tweeted texts and the background of the tweets.I want the user to have custom settings for the tweet box.Is their something present or I need to build it?
I am using PHP on server side.
Try http://twitterforweb.com
If You look closely at embed code there is "settings" parameter which You can edit same as at the project site :)

Pulling Public Facebook Posts Into PHP Page

Last December, I set up an app for a client who wanted to pull their public facebook posts into the footer of their website.
I was using this URL to pull the message, create time and permalink and when I wrote it, all was good:
http://api.facebook.com/method/fql.query?query=SELECT%20message,%20created_time,%20permalink%20FROM%20stream%20WHERE%20source_id=138631878804%20AND%20message%3C%3E%27%27%20limit%203
Today they reported that it was no longer pulling their information. I put that url into a browser and the result is "Requires valid signature"
I've gathered from google that I need something called an access_token, also I've seen where I can use the php sdk but then I need an appId and a secret token.
At this point, I've read so many different sources that I am thoroughly confused. The FQL query above represents the full extent of my Facebook programming experience. It looks like maybe I want the Graph API, but I don't want anyone to have to sign into anything.
Can one of you guys who are more versed in the voodoo of facebook nudge me in the right direction to do this:
From PHP, pull public messages from the stream table without forcing a user to log into facebook.
Thanks!!
To pull posts from a publicly visible Page on Facebook, you can use any valid access token. For most sites managing a page, this will be a page access token retrieved via one of the page's admins authorising your app to have access to their pages, but that might be overkill for your use-case.
Probably the quickest solution is to just create a new App ID for the site, get the app access token for that App (see 'App Login' on https://developers.facebook.com/docs/authentication/ ) and then use that access token to retrieve the posts.
I found several links all from a simple Google search.
Duplicate question: https://stackoverflow.com/questions/3298836/how-you-get-access-tokens-for-facebook
http://benbiddington.wordpress.com/2010/04/23/facebook-graph-api-getting-access-tokens/
https://developers.facebook.com/docs/authentication/

Change Facebook profile image via API

Is it possible to change someone's profile picture via the Facebook API?
The Graph API discusses POSTing a picture to an account but I see nothing related to the direct altering of a user account. I suspect they only recognize GET requests under their RESTful API (for the user area). Thus, a no.
That's just information gleaned from the Facebook API docs, however. I could be missing something though.
not possible: Facebook API/PHP - Is it possible to change a user's profile image via FB Graph API?, and also my own experience.
This feature is not possible, period. Although you can upload an image to the Graph API and then redirect the user to the permalink of that post :)
It's possible by adding makeprofile=1 at the end of uploaded photo url. You can find example (PHP) and demo here: http://4rapiddev.com/facebook-graph-api/php-change-facebook-profile-picture-with-graph-api/

Categories