-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.php
More file actions
48 lines (35 loc) · 1.15 KB
/
data.php
File metadata and controls
48 lines (35 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<html>
<title>League of Legends</title>
<body>
<?php
$User = $_POST['usuario'];
$Region = $_POST['region'];
$req = 'http://legendaryapi.com/api/v1.0/'.$Region.'/summoner/getSummonerByName/'.$User;
$cUser = curl_init($req);
curl_setopt($cUser,CURLOPT_RETURNTRANSFER, TRUE);
$dUser = curl_exec($cUser);
$getUserInfo = json_decode($dUser, TRUE);
$Username = $getUserInfo['name'];
$Level = $getUserInfo['summonerLevel'];
$AccountID = $getUserInfo['acctId'];
echo "El Usuario es: ".$Username;
echo "<br>";
echo "Su nivel es: ".$Level;
echo "<br>";
echo "Su nivel es: ".$AccountID;
/* Ahora Tweeteamos la Informacion */
$config = array(
'consumer_key' => 'JYzdejAC5OMWFDu6XdFwfg',
'consumer_secret' => 'hFdxXwoEf6oAKIFc7AbS11Bk5KHGYY2s9oK3RL96s',
'oauth_token' => 'aquivaeltoken',
'oauth_token_secret' => 'aquivaelsecret',
'output_format' => 'object'
);
include ("TwitterOAuth.php");
include ("Exception/TwitterException.php");
use TwitterOAuth\TwitterOAuth;
$tweet = new TwitterOAuth($config);
$tweet->post('statuses/update', array('status' => 'El Usuario Es: '.$Username.' y su nivel es: '.$Level.''));
?>
</body>
</html>