You need to sign in to do that
Don't have an account?

Salesforce Integration With Facbook & Twitter
Hi ,
I want to integrate Facbook and Twitter application with my salesforce application. Can Any1 help me how to post and update status on Facbook wall and Twitter Using HTTP Request(OAuth). Is there any sample code available then please share.
Thanks!
Hi,
You can use the below sample code to update the status in to twitter directly form salesforce
------------ SAMPLE CODE ------------
VF CODE:
<apex:inputTextarea id="tweetInput" onkeyup="return maxLength();" onKeyPress="return maxLength();" value="{!newTweet}" rows="2" cols="73"/>
<apex:commandButton id="tweetBtn" style="height:35px;" value="Tweet" action="{!postTweet}" />
Controller code:
*** post tweets into twitter*/
public String newTweet{get;set;}
public Void postTweet()
{
Http h = new Http();
HttpRequest req = new HttpRequest();
Method = 'POST';
req.setMethod(Method);
req.setEndpoint('https://api.twitter.com/1/statuses/update.xml');
newTweet = newTweet.replace('%','%25').replace('&','%26').replace('@','%40').replace(';','%3B').replace('?','%3F').replace('/','%2F').replace(':','%3A').replace('#','%23').replace('=','%3D').replace('+','%2B').replace('$','%24').replace(',','%2C').replace(' ','%20').replace('<','%3C').replace('>','%3E').replace('{','%7B').replace('}','%7D').replace('[','%5B').replace(']','%5D').replace('`','%60').replace('|','%7C').replace('\\','%5C').replace('^','%5E').replace('"','%22').replace('\'','%27').replace('!','%21').replace('*','%2A').replace('(','%28').replace(')','%29').replace('~','%7F');
req.setBody('status='+newTweet);
req.setHeader('Content-Type','application/x-www-form-urlencoded');
OAuth oa = new OAuth();
if(!oa.setService())
{
message=oa.message;
}
oa.sign(req);
HttpResponse res = h.send(req);
system.debug('&&&&&&&&&&&&&&&&7' + res.getBody());
PostTweetbody = res.getBody() + '___' + message;
newTweet = '';
}
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
Thank you, its works.
I want to do the same in facebook (post text on facebook wall) from apex buton. If you have work on salesforce integration with facebook , then please show some sample code regarding faceboook.
Plus i want to know, how we authorized with facebook application( getting access token/access token secret of facebook application)in salesforce.
Thanks!
Asia Naseer.
OAuth oa = new OAuth();
is it work?
Hi AlL,
I want to get the tweets of my contacts who uses Twitter.
Using Oauth.
How to get started.?
Thanks,
Subham
Can we use salesforce twitter appexchange code to be modify as per our requirement. after integrating or installing?
I am a final year MTech student and working on API integration as my dissertation work.Can anyone write the steps and code for salesforce integration with twitter through API?? it will be helpful for my dissertation..