Skip to content

Instantly share code, notes, and snippets.

:octocat:

Vincent Willcox vwillcox

:octocat:
Block or report user

Report or block vwillcox

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vwillcox
vwillcox / nasa-windows-toast-and-caption.py
Created Jun 5, 2019
Take the Nasa AOD. add a sprinkling of Toast and a Pillow and you have a script that changes your desktop daily and adds the caption to the bottom. Thanks to : https://bigl.es/tooling-tuesday-nasa-api-and-python/
View nasa-windows-toast-and-caption.py
import os
import requests
import ctypes
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
from win10toast import ToastNotifier
url = "https://api.nasa.gov/planetary/apod?api_key="
os.environ['NO_PROXY'] = 'nasa.gov'
@vwillcox
vwillcox / nasa-windows-toast.py
Created Jun 5, 2019
Get Nasa AOD and set as a Windows desktop image, also send a notification with image title and description. Thanks to Big Les (https://bigl.es/tooling-tuesday-nasa-api-and-python/)
View nasa-windows-toast.py
import os
import requests
import ctypes
from win10toast import ToastNotifier
url = "https://api.nasa.gov/planetary/apod?api_key="
os.environ['NO_PROXY'] = 'nasa.gov'
r = requests.get(url)
toaster = ToastNotifier()
@vwillcox
vwillcox / nasa-windows-toast.py
Last active Jun 5, 2019
Get Nasa's Image of the Day, set it as a background on Windows 10 and push a notification. Special thanks to Les Pounder for the original code
View nasa-windows-toast.py
import os
import requests
import ctypes
from win10toast import ToastNotifier
url = "https://api.nasa.gov/planetary/apod?api_key="
os.environ['NO_PROXY'] = 'nasa.gov'
r = requests.get(url)
toaster = ToastNotifier()
@vwillcox
vwillcox / Tesco1.py
Created Jan 7, 2019
Tesco.com Product Grocery Search API Python3 quick demo script
View Tesco1.py
########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64, json, jsonify
import sys, getopt
def main(argv):
query = ''
offset = 0
limit = 10
@vwillcox
vwillcox / EnviroPhatandScrollPhatHD.py
Created Oct 28, 2018
Take the LUX level and room temp from an Enviro Phat and show the room temp on a Scroll Phat HD
View EnviroPhatandScrollPhatHD.py
#!/usr/bin/env python
import time
import numpy as np
import subprocess
from envirophat import weather, leds, light
import scrollphathd as sphd
from scrollphathd.fonts import font3x5
sphd.clear()
View veho.py
#!/usr/bin/python3
import sys, getopt
import tikteck
def connecttoBulb(b):
bulb = tikteck.tikteck(b, "Smart Light", "[PASSWORD]")
bulb.connect()
return bulb
View scrape_tesco_search.py
import requests
from bs4 import BeautifulSoup
response = requests.get('http://www.tesco.com/groceries/en-GB/search?query=blueberry')
soup = BeautifulSoup(response.text, 'html.parser')
for item in soup.select('.product-list--list-item'):
try:
product = item.find(class_='product-image').get('alt', '')
value = item.find(class_='value').get_text()
View unicornhat-cheerlights.py
#!/usr/bin/env python
import time
import unicornhat as unicorn
import urllib
unicorn.set_layout(unicorn.AUTO)
unicorn.rotation(0)
unicorn.brightness(0.5)
width,height=unicorn.get_shape()
View thingspeak.py
#!/usr/bin/env python2
from envirophat import weather
import time, os, sys, urllib, urllib2
THINGSPEAKKEY = 'ENTERYOURAPIKEY'
THINGSPEAKURL = 'https://api.thingspeak.com/update'
def sendData(url, key, field1, field2, temp, pres):
values ={'api_key' : key, 'field1' : temp, 'field2' : pres}
@vwillcox
vwillcox / pijuice-charge.py
Created Jun 6, 2018
Python script to show Charge of attached PiJuice module on a SchollPhat
View pijuice-charge.py
#!/usr/bin/env python
import math
import sys
import time
import scrollphat
import json
from pijuice import PiJuice # Import pijuice module
You can’t perform that action at this time.