Skip to content

Instantly share code, notes, and snippets.

View luizmarcus's full-sized avatar

Luiz Marcus luizmarcus

View GitHub Profile
<?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'];
<?php
include('simple_html_dom.php');
define('BASE_URL',"http://g1.globo.com/loterias/");
define('URL_MEGA', BASE_URL.'megasena.html');
define('URL_QUINA', BASE_URL.'quina.html');
define('URL_LOTOMANIA', BASE_URL.'lotomania.html');
define('URL_LOTOCACIL', BASE_URL.'lotofacil.html');
<?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'];
DigitsAuthButton digitsAuthButton = (DigitsAuthButton) findViewById(R.id.auth_button);
digitsAuthButton.setCallback(callback);
digitsAuthButton.setAuthTheme(android.R.style.Theme_Material);
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="CustomDigitsTheme" parent="Theme.AppCompat.Light">
<item name="android:textColorPrimary">@android:color/black</item>
<item name="android:textColorSecondary">@android:color/darker_gray</item>
<item name="android:windowBackground">@android:color/white</item>
<item name="android:textColorLink">#ff398622</item>
<item name="colorAccent">#ffacee</item>
</style>
</resources>
DigitsAuthButton digitsAuthButton = (DigitsAuthButton) findViewById(R.id.auth_button);
digitsAuthButton.setCallback(callback);
digitsAuthButton.setAuthTheme(R.style.CustomDigitsTheme);
compile('com.mikepenz:materialdrawer:5.3.6@aar') {
transitive = true
}
private void createDrawer(){
//Itens do Drawer
PrimaryDrawerItem item1 = new PrimaryDrawerItem().withIdentifier(1).withName(R.string.menu1);
PrimaryDrawerItem item2 = new PrimaryDrawerItem().withIdentifier(2).withName(R.string.menu2);
PrimaryDrawerItem item3 = new PrimaryDrawerItem().withIdentifier(3).withName(R.string.menu3);
//Definição do Drawer
Drawer drawer = new DrawerBuilder()
.withActivity(this)
public class MainActivity extends AppCompatActivity {
private Toolbar toolbar;
private TextView textView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
PrimaryDrawerItem item1 = new PrimaryDrawerItem().withIdentifier(1).withName(R.string.menu1).withIcon(android.R.drawable.ic_menu_add);
PrimaryDrawerItem item2 = new PrimaryDrawerItem().withIdentifier(2).withName(R.string.menu2).withIcon(android.R.drawable.ic_menu_delete);
PrimaryDrawerItem item3 = new PrimaryDrawerItem().withIdentifier(2).withName(R.string.menu3).withIcon(android.R.drawable.ic_menu_camera);