Coder Social home page Coder Social logo

tolha's Introduction

Tolha - โทรหา

เข้าถึงประวัติการโทรของตัวเองง่ายๆ จากค่ายมือถือของคุณ

ช่วยคุณนับความคิดถึงใครซักคนแบบ programmable

Highlight and Feature

  1. fully-type, with pydantic
  2. no docs, since api is so simple #hackerStyle
  3. Support Python 3.10.1+ #hackerStyle

Get Started

# support python 3.10+
pip install tolha
from tolha.myais import get_all_call_history

# type down, myais credential
invoices, call_usages = get_all_call_history(phone_number_or_username='0995555555', password='password1234', national_id='1515566254125')

print(invoices[0])
# Invoice(invoice_number='W-IN-16-6412-xxxxxx', is_required_sr=False, period_description='ค่าใช้บริการวันที่ 24/11/2021 - 23/12/2021 (Due Date 15/01/2022)', period_from='24/11/2021', period_to='23/12/2021', payment_due_date='15/01/2022', total_balance='405.75', outstanding_balance='0.00', is_payable=False, event_seq='211224000', billing_system='NONBOS', bill_cycle='ธันวาคม 2564', remark='สามารถดูใบแจ้งค่าใช้บริการได้วันที่ 30 ธ.ค. 2564')


print(call_usages['ธันวาคม 2564'][0])
# Call(datetime=datetime.datetime(2021, 11, 24, 9, 43), destination_phoneNumber='08xxxxxxxx', destination_network='AIS', origin='Udon Thani', destination='AIS', addons='', duration=datetime.timedelta(seconds=60), calculated_cost=1.5, actual_cost=0.0, note='')

Dev

This is a movement.

Feel free to join and enlighten yourself, make your life a bit more programmable. See https://dogsheep.github.io/ or Medium - “มหาสติ Digital” การมีความตระหนักรู้ทุก Bits & Bytes

Roadmap

  1. add other metric
  2. make cli
  3. add other telco
  4. add async
  5. add other non telco - read facebook messenger dump/ google duo dump

Tools for CSS Selector

use https://chrome.google.com/webstore/detail/selectorgadget/mhjhnkcfbdhnjickkkdbjoemdmbfginb

tolha's People

Contributors

wasdee avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

tolha's Issues

tolha connot run on jupyter notebook

---------------------------------------------------------------------------
Error                                     Traceback (most recent call last)
<ipython-input-7-86031215e230> in <module>
----> 1 call_usage = get_recent_call_history("09xxxxx", "c4xxxxxxx", "141xxxxxxx")

~\WinDevs\codustry\tolha\tolha\myais.py in get_recent_call_history(phone_number, password, national_id)
      4 
      5 def get_recent_call_history(phone_number, password, national_id):
----> 6     with sync_playwright() as p:
      7         browser = p.chromium.launch(headless=False)
      8         page = browser.newPage()

~\anaconda3\lib\site-packages\playwright\__init__.py in sync_playwright()
     32 
     33 def sync_playwright() -> SyncPlaywrightContextManager:
---> 34     return SyncPlaywrightContextManager()
     35 
     36 

~\anaconda3\lib\site-packages\playwright\main.py in __init__(self)
     86 class SyncPlaywrightContextManager:
     87     def __init__(self) -> None:
---> 88         self._connection = run_driver()
     89         self._playwright: SyncPlaywright
     90 

~\anaconda3\lib\site-packages\playwright\main.py in run_driver()
     80     loop = asyncio.get_event_loop()
     81     if loop.is_running():
---> 82         raise Error("Can only run one Playwright at a time.")
     83     return loop.run_until_complete(run_driver_async())
     84 

Error: Can only run one Playwright at a time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.