i3Designer Posted June 5, 2014 Share Posted June 5, 2014 I have a score variable score = 100; I can share the score on twitter or facebook? Arlefreak 1 Link to comment Share on other sites More sharing options...
Nambiar Posted June 5, 2014 Share Posted June 5, 2014 While there are ways to use the Twitter API, I usually use the following to share score on twitter :-function tweetscore(){ //share score on twitter var tweetbegin = 'http://twitter.com/home?status='; var tweettxt = 'I scored '+tweetnumber+' at this game -' + window.location.href + '.'; var finaltweet = tweetbegin +encodeURIComponent(tweettxt); window.open(finaltweet,'_blank'); }The above opens a new window with a ready tweet that has the game score (tweetnumber) and also the game url (window.location.href). Facebook is a little more involved and I am still figuring it out. spinnerbox, aurelien974, GNUton and 3 others 6 Link to comment Share on other sites More sharing options...
x2l2 Posted July 30, 2014 Share Posted July 30, 2014 Thanks, thats help me ! in facebook you need to create a facebook app to get an api key and have access to custom text , if you dont use that you only cant have a link without custom text ( you can have a predefined text but cant update score p.e) you can read about it here : http://stackoverflow.com/questions/20956229/has-facebook-sharer-php-changed-to-no-longer-accept-detailed-parameters Link to comment Share on other sites More sharing options...
lewster32 Posted July 30, 2014 Share Posted July 30, 2014 If you're willing to get your hands a little dirty with the Facebook JavaScript API and the associated mini-hell that is setting up an app correctly, the Scores API is really nice. Sorry yes, I know I'm not selling that brilliantly, and it has become easier in recent times, but it's still a huge pain in the ass Link to comment Share on other sites More sharing options...
Recommended Posts