Skip to content

Instantly share code, notes, and snippets.

@inclement
Last active May 27, 2019 13:34
Show Gist options
  • Save inclement/dcd0c2fb8b8e0f02b72060e31237efa3 to your computer and use it in GitHub Desktop.
Save inclement/dcd0c2fb8b8e0f02b72060e31237efa3 to your computer and use it in GitHub Desktop.
url = "https://genius.com/Joyner-lucas-isis-lyrics"
def news():
global lyrics
page = urlopen(Request(url, headers={'User-Agent': 'Mozilla'}))
soup = BeautifulSoup(page, "html.parser")
lyrics = soup.p.text.strip()
news()
class MyFloatLayout(FloatLayout):
mylabel = ObjectProperty("")
def on_mylabel(self, instance, value):
if self.mylabel is not None:
self.mylabel.text = lyrics
def btn(self):
news()
print(lyrics)
class MyApp(App):
def build(self):
Window.clearcolor = (.13, .13, .13, 1)
return MyFloatLayout()
if __name__ == "__main__":
MyApp().run()
<Button>:
font_size: 40
color: 0.1,0.5,0.6,1
size_hint: 0.3, 0.1
<MyFloatLayout>:
Label:
pos_hint:{"top":1}
id: mylabel
Button:
pos_hint:{"bottom":1}
text: "RE-SEARCH"
font_size: 10
on_press: root.btn()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment