Skip to content

Instantly share code, notes, and snippets.

View oskarsh's full-sized avatar
🐢
interested in life and other forms of art

oskar oskarsh

🐢
interested in life and other forms of art
View GitHub Profile
dbus-send --session --dest=org.kde.plasmashell --type=method_call /PlasmaShell org.kde.PlasmaShell.evaluateScript 'string:
var Desktops = desktops();
for (i=0;i<Desktops.length;i++) {
d = Desktops[0];
d.wallpaperPlugin = "org.kde.image";
d.currentConfigGroup = Array("Wallpaper",
"org.kde.image",
"General");
d.writeConfig("Image", "file:'$1'");
}'
@oskarsh
oskarsh / coincrawler-beautiful.py
Created June 19, 2018 09:48
This will work like the coincrawler in a more general way using the BeautifulSoup module.
import urllib.parse
import urllib.request
from bs4 import BeautifulSoup
from pprint import pprint
def urlReader(url):
print("")
print("fetching data from coinmarketcap.com")
req = urllib.request.Request(url)
resp = urllib.request.urlopen(req)
import requests
#specify the api of coinmarketcap
url = https://api.coinmarketcap.com/v1/ticker/?convert=EUR&Limit=10
# for every coin we find on the website
for coin in requests.get(url).json():
print(coin['name], coin['price_usd’])