Skip to content

Instantly share code, notes, and snippets.

@ihfazhillah
Created December 22, 2015 13:29
Show Gist options
  • Save ihfazhillah/0b5b6c608e155ff94c3d to your computer and use it in GitHub Desktop.
Save ihfazhillah/0b5b6c608e155ff94c3d to your computer and use it in GitHub Desktop.
Menampilkan tanggalan hijriyah hari ini di android menggunakan android helper requests dan beautifulsoup library
from beautifulsoup import BeautifulSoup
from androidhelper import Android
import requests
def hijri_now():
resp = requests.get("http://beta.islamicfinder.org")
soup = BeautifulSoup(resp.content)
date_html = soup.find("div", {"class" : "date-box2"})
return date_html.text.strip()
if __name__ == "__main__":
droid = Android()
droid.dialogCreateAlert(title="Tanggal Hijriah",
message = hijri_now() )
droid.dialogSetPositiveButtonText("Done")
droid.dialogShow()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment