s00d / onlinesim-python-api Goto Github PK
View Code? Open in Web Editor NEWPython Wrapper for automatic reception of SMS-messages by onlinesim.ru
Home Page: https://onlinesim.ru
License: Apache License 2.0
Python Wrapper for automatic reception of SMS-messages by onlinesim.ru
Home Page: https://onlinesim.ru
License: Apache License 2.0
can u help me to setup on my cpanel and doamin i cannt setup it
In the example to get the code, you specified the following:
from onlinesimru import Driver
def main():
driver = Driver('YOUR_TOKEN')
tzid = driver.numbers().get('service')
print(tzid)
code = driver.numbers().wait_code(tzid)
print(code)
main()
When receiving SMS from Telegram, this method displays ID messages.
[13464390577]where full SMS is
[16042601337] Telegram code 98454
I propose to add an example to receive SMS from a telegram.
from onlinesimru import Driver
def main():
driver = Driver('YOUR_TOKEN')
tzid = driver.numbers().get('service')
print(tzid)
code = driver.numbers().wait_code(tzid=tzid, full_message=True)
code = code.split('Telegram code ')
print(code[1])
main()
Thanks
Why is the API call https://onlinesim.ru/api/getFreeMessageList?cpage=1&phone=+46700000000 not working and returning an empty data field? Note: I've replaced the phone number with a working phone number from onlinesim.ru.
Still, the data fields are always empty. This should be a functioning API call according to the documentation (https://onlinesim.ru/docs/api/en/free/getFreeMessageList)
Ok, i just want to know how i buy a number and then get the code out of it?
The params i need are: the number, the code
Sry if this is a dumb quest ;:D .-.
Thanks in advance
Delete
Hello, thank you for api. I have several questions about how it works ;)
code = driver.numbers().wait_code(tzid=tzid, timeout=60*3)
if sms-message did not received and timeout was expired will raised unexpected error:
File GetNumbers.py line 53.
if response['code'] and not not_end and response['code'] != __last_code:
KeyError: 'code'
And can you raise custom exception instead of Exception, because it's hard to resolve it?
File GetNumbers line 49:
while True:
time.sleep(timeout)
counter += 1
if counter >= 10:
raise ('Timeout error') <-----THIS
response = self.stateOne(tzid, 1, False)
So through web you can ban bad number after some time.
How can i do it using api?
Thanks!
Hi, in the beginning your lib have async features, but you remove it, can i to know why?
Good day!
Can you implement parameter "ban" for function close?
GetNumbers.py line 29
def close(self, tzid: int):
return self._get(f'/setOperationOk', {'tzid': tzid})
According documentation you can ban number after 5 min waiting.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.