Last active
April 21, 2017 21:54
-
-
Save ayancey/2f3fcc094bc6a89c897a692b975cd5a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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