Skip to content

Instantly share code, notes, and snippets.

@ayancey
Last active April 21, 2017 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayancey/2f3fcc094bc6a89c897a692b975cd5a4 to your computer and use it in GitHub Desktop.
Save ayancey/2f3fcc094bc6a89c897a692b975cd5a4 to your computer and use it in GitHub Desktop.
import ui
import appex
import requests
import json
if appex.is_running_extension():
url = appex.get_url()
else:
url = 'https://dynasty-scans.com/chapters/together_with_hecaa_chan_2'
r = requests.get(url)
urls = []
for x in json.loads(r.text.split('var pages = ')[1].split(';')[0]):
urls.append('https://dynasty-scans.com' + x['image'])
current_page = 0
def previous_button(sender):
global current_page
if current_page > 0:
current_page -= 1
v['webview1'].load_html('<img src="' + urls[current_page] + '"/>')
def next_button(sender):
global current_page
if current_page < len(urls) - 1:
current_page += 1
v['webview1'].load_html('<img src="' + urls[current_page] + '"/>')
v = ui.load_view()
v.present('sheet', hide_title_bar=True)
v['webview1'].load_html('<img src="' + urls[current_page] + '"/>')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment