2017-01-30 10:45:11 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
from bs4 import BeautifulSoup
|
|
|
|
try:
|
|
|
|
with open('/tmp/lastfm.html', 'r') as myfile:
|
|
|
|
data = myfile.read()
|
|
|
|
soup = BeautifulSoup(data, 'html.parser')
|
|
|
|
chartlist = soup.find(class_="chartlist-now-scrobbling").parent.parent.find(class_='chartlist-name').get_text().strip().replace('\n', '')
|
|
|
|
print(chartlist)
|
|
|
|
except Exception as e:
|
2017-02-02 07:59:05 +00:00
|
|
|
with open('/home/nemo/.cmus/now-playing.txt', 'r') as myfile:
|
|
|
|
print(myfile.read().strip())
|
|
|
|
exit(0)
|