This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$redirect_uri = $_GET['redirect_uri']; | |
$account_linking_token = $_GET['account_linking_token']; | |
?> | |
<html> | |
<body> | |
<form action="validate.php" method="GET"> | |
<input type="hidden" name="redirect_uri" value="<?=$redirect_uri?>"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$redirect_uri = $_GET['redirect_uri']; | |
$account_linking_token = $_GET['account_linking_token']; | |
$authorization_code = $_GET['authorization_code']; | |
$username = $_GET['username']; | |
$password = $_GET['password']; | |
$url =""; | |
if ($username === "teste" && $password === "teste"){ | |
$url = $redirect_uri.'&authorization_code='.$authorization_code; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"sender":{ | |
"id":"USER_ID" | |
}, | |
"recipient":{ | |
"id":"PAGE_ID" | |
}, | |
"timestamp":1234567890, | |
"account_linking":{ | |
"status":"linked", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compile 'com.github.hotchemi:android-rate:1.0.1' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AppRate.with(this) | |
.setInstallDays(0) //Conta os dias de instalação do aplicativo no smartphone do usuário. Padrão é 10. 0 significa "mesmo dia da instalação" | |
.setLaunchTimes(0) //Conta o número de vezes que o usuário abriu o app. Padrão é 10 | |
.setRemindInterval(0) // Intervalo de dias entre uma exibião e outra, caso o usuário clique em "avaliar mais tarde" | |
.setShowLaterButton(true) // Exibir o botão "Avaliar mais tarde" | |
.setDebug(false) // Mostrar debug | |
.setOnClickButtonListener(new OnClickButtonListener() { | |
@Override | |
public void onClickButton(int which) { | |
Log.d(MainActivity.class.getName(), Integer.toString(which)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
AppRate.with(this) | |
.setInstallDays(0) //Conta os dias de instalação do aplicativo no smartphone do usuário. Padrão é 10. 0 significa "mesmo dia da instalação" | |
.setLaunchTimes(0) //Conta o número de vezes que o usuário abriu o app. Padrão é 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sendMessage("sendMessage", array('chat_id' => $chat_id, "text" => 'Olá, '. $message['from']['first_name']. | |
'! Escolha um dos jogos abaixo para ver o resultado diretamente no site do G1.', | |
'reply_markup' => array('inline_keyboard' => array( | |
//linha 1 | |
array( | |
array('text'=>'Mega-Sena','url'=>'http://g1.globo.com/loterias/megasena.html'), //botão 1 | |
array('text'=>'Quina','url'=>'http://g1.globo.com/loterias/quina.html')//botão 2 | |
), | |
//linha 2 | |
array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'reply_markup' => array('inline_keyboard' => array( | |
//linha 1 | |
array( | |
array('text'=>'Mega-Sena','url'=>'http://g1.globo.com/loterias/megasena.html'), //botão 1 | |
array('text'=>'Quina','url'=>'http://g1.globo.com/loterias/quina.html')//botão 2 | |
), | |
//linha 2 | |
array( | |
array('text'=>'Lotofácil','url'=>'http://g1.globo.com/loterias/lotofacil.html'), //botão 3 | |
array('text'=>'Lotomania','url'=>'http://g1.globo.com/loterias/lotomania.html')//botão 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require('parser.php'); | |
define('BOT_TOKEN', 'SEU TOKEN'); | |
define('API_URL', 'https://api.telegram.org/bot'.BOT_TOKEN.'/'); | |
function processMessage($message) { | |
// processa a mensagem recebida | |
$message_id = $message['message_id']; |