Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RaspiPot

INTRODUÇÃO Esta aplicação foi criada como Hobby para estudos com Raspberry Pi + Python, usando a API do Telegram, foram adicionados alguns comandos e que retornam informações diversas, conforme lista abaixo.

/roll = Retorna um valor entre 1 ate 10
/time = Retorna a hora do sistema
/cput = Retorna temperatura do processador "Apenas Linux"
/loop = Retorna uma mensagem aleatória
/weather = Informações meteorológicas de Belo Horizonte
/currency = Cotacao de moedas (Dólar, Euro, Libra, Bitcoin)
/uptime = Verifica quanto tempo está ligado o equipamento "Apenas Linux"
/version = Versão do Bot
/print = Envia uma imagem de uma rola "pássaro" será implementado para envio de relatórios de trafego da interface de rede com a aplicação "vnststi"
/meme = Envia um link de um meme randômico

Adicionado resolvedor de operações matemáticas, sendo necessário apenas informar o que quer resolver, usando os caracteres de operações em python. Por exemplo 5*5 ou 5**3 ou 3 + 4

A conta será resolvida e o retorno no telegram, será o resultado da soma.

MODULOS Foram utilizados diversos módulos, vários deles já vem instalados por padrão. time, random, datetime, os, subprocess, platform, telepot, json, requests

Foi utilizado um exemplo básico de envio de mensagens

Instalar telepot( módulo responsavel pelo envio de mensanges usando API do telegram diretamente do Python) https://github.com/nickoala/telepot

Documentação do Modulo Json(Usado na coleta dos dados atmosféricos e financeiros atraves das respectivas APIs. https://docs.python.org/3/library/json.html

Como módulo Requests https://github.com/kennethreitz/requests

ACESSO A API DO TELEGRAM Inicialmente para utilizar o bot no Telegram, é necessário ter o token, que é gerado pelo @BotFather, instruções no link https://core.telegram.org/bots#6-botfather Para este Bot, eu utilizei um arquivo externo, que atualmente não está no projeto, sendo necessário que você crie o arquivo com o nome "token.txt", depois inserir o seu token no arquivo na raiz da aplicação.

ACESSO A OUTRAS APIs Foram utilizada outras APIs, com funções diversas como:

Coleta de dados atmosféricos Documentação aqui https://hgbrasil.com/status/weather/ API:https://api.hgbrasil.com/weather/

Coleta de dados financeiros em relação a moeda brasileira

API:http://api.promasters.net.br/cotacao/ Retorna as seguintes moedas Dólar, Euro, Libra, Bitcoin Caso a API de cotação apresente problemas de conexão, foi inserido uma API reserva https://economia.awesomeapi.com.br/json/USD-BRL/1 que retorna o apenas valor do dólar em reais brasileiros.

English version

RaspiPot

INTRODUCTION This application was created as a Hobby for studies with Raspberry Pi + Python, using the Telegram API, some commands have been added and they return several information, as listed below.

/roll = Returns a value from 1 to 10
/time = Returns the system time
/cput = Return processor temperature "Linux only"
/loop = Returns a random message
/weather = Belo Horizonte Weather Information
/currency = Currency Coin (Dollar, Euro, Pound, Bitcoin)
/uptime = Check how long the "Linux only" machine is connected
/version = Bot Version
/print = Send an image of "bird" will be implemented to send traffic reports of the network interface with the application "vnststi"
/meme = Send a link from a random meme

Added solver of mathematical operations, being necessary only to inform what it wants to solve, using the characters of operations in python. For example 5 * 5 or 5 ** 3 or 3 + 4

The account will be resolved and the return on the telegram will be the result of the sum.

MODULES Many modules have been used, some are already installed by default. Time, random, datetime, os, subprocess, platform, telepot, json, requests

Install telepot (module responsible for sending messages using telegram API directly from Python) Https://github.com/nickoala/telepot

Json Module Documentation (Used in the collection of atmospheric and financial data through their respective APIs) Https://docs.python.org/3/library/json.html

As Requests module Https://github.com/kennethreitz/requests

TELEGRAM API Initially to use the bot in Telegram, it is necessary to have the token, which is generated by @BotFather, instructions on the link https://core.telegram.org/bots#6-botfather For this Bot, I used an external file, which is not currently in the project, it is necessary that you create the file named "token.txt", then insert your token in the file at the root of the application.

OTHER API Other APIs were used, with several functions such as:

Atmospheric data collection Documentation here https://hgbrasil.com/status/weather/ API: https: //api.hgbrasil.com/weather/

Collection of financial data in relation to Brazilian currency

API: http: //api.promasters.net.br/cotacao/ Returns the following currency Dollar, Euro, Libra, Bitcoin If the quotation API presents connection problems, a reserve API has been inserted https://economia.awesomeapi.com.br/json/USD-BRL/1 which returns the only dollar value in BRL.

N|Solid

About

No description, website, or topics provided.

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages