Jump to content

[REL]Twitter MTA


FatalTerror

Recommended Posts

11102808400087517.png

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 !

111029094725808575.jpg

Security:

this system is fully safe. Informations can't be stolen this way!

Sry for bad english :oops:

Thx, FatalTerror.

Edited by Guest
Link to comment

Public release:

Bugs detected:

  • Every tweets go on the user account and on the owner of application (me xD)

@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
  • 6 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...