FatalTerror Posted October 28, 2011 Share Posted October 28, 2011 (edited) Twitter MTA Hi everybody! I just came to make a "like" script. It means you can like a map like on facebook or twitter. I tried it with Facebook but i've got troubles with my account so i tried it with twitter. Example When you're connected to the mta server : Write /like to tell people you like the map you're currently playing on the server. On the website : You can see what maps have been "liked" by any player. On twitter : an application is activated and receives the information which will be transfered to your own account. Codes For send the informations to the website you can use callRemote() callRemote ( "http://www.watzuku.com/MTA/index.php", tweeter_feedback, name, ip, message ) 1 argument: The url of the website. 2 argument: the call back function 3, 4, 5 argument: Informations to send to website (the name of the player, ip of the player, and the message of the tweet) Now we have send informations to our website, for receives informations in the website you can use: /!\ The script use PHP SDK ! include( "mta_sdk.php" ); $input = mta::getInput(); $name = $input[0]; $ip = $input[1]; $message = $input[2]; For send the informations on Twitter you can use the TwitterOAuth. <?php function tweet($message) { require 'tmhOAuth.php'; $tmhOAuth = new tmhOAuth(array( 'consumer_key' => '', 'consumer_secret' => '', 'user_token' => '', 'user_secret' => '', )); $tmhOAuth->request('POST', $tmhOAuth->url('statuses/update'), array( 'status' => utf8_encode($message) )); if ($tmhOAuth->response['code'] == 200) {return TRUE;} else {return FALSE;} } ?> You see it's possible, i will show u more later. Demo: For a demo, you can visit the AMG server and use /like in a map. I don't want give this resource to public now. You must be logged in Twitter ! Security: this system is fully safe. Informations can't be stolen this way! Sry for bad english Thx, FatalTerror. Edited October 29, 2011 by Guest Link to comment
Otto Posted October 28, 2011 Share Posted October 28, 2011 Should be on Development! Nice work! Link to comment
FatalTerror Posted October 29, 2011 Author Share Posted October 29, 2011 Public release: Script for server: https://community.multitheftauto.com/index.php?p=resources&s=details&id=3112 PHP Files for website: http://www.megaupload.com/?d=IY8PKCNE Bugs detected: Every tweets go on the user account and on the owner of application (me ) @Otto: Thanks! I'll see if I can fix bugs and improve the existing system. And if all this happens without any problems, i make it on Facebook. Link to comment
CapY Posted October 29, 2011 Share Posted October 29, 2011 It would be great to see it on FB. Link to comment
FatalTerror Posted October 29, 2011 Author Share Posted October 29, 2011 Yeah me too, but with Facebook have "permission" system. The user must autorise the application to post in his wall. This system suck... I don't know how continue Link to comment
Karevan Posted May 26, 2012 Share Posted May 26, 2012 Megaupload... =/ is there a chance someone could upload it on a new host (PHP files) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now