Skip to content

Instantly share code, notes, and snippets.

@ayancey
Last active Apr 21, 2017
Embed
What would you like to do?
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