Skip to content

Instantly share code, notes, and snippets.

View gist:ba648912c64179e7b8b8
import RPi.GPIO as GPIO
import time
from BeautifulSoup import BeautifulSoup
import urllib2
#change this bit
url="http://www.kimondo.co.uk/swingometer-control/"
page=urllib2.urlopen(url)
soup = BeautifulSoup(page.read())
View gist:42c39f9cc6d6f9c18b2d
<?php
$rss = new DOMDocument();
#feed info here
$rss->load('http://feeds.bbci.co.uk/news/rss.xml');
$feed = array();
foreach ($rss->getElementsByTagName('item') as $node) {
$item = array (
'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
#I'm just using the title
#'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
@kimondo
kimondo / Raspberry Pi Pi-Lite web counter
Created Nov 19, 2013
Raspberry Pi Pi-Lite web counter - grabs some stats off the wordpress stats API and then sends them to the serial port to be picked up by an arduino based LED display (ciseco.co.uk Pi-Lite or wharfe-education.com BelleVue)
View Raspberry Pi Pi-Lite web counter
import serial
import time
import urllib2
from BeautifulSoup import BeautifulSoup
# Configure Pi serial port
s = serial.Serial()
s.baudrate = 9600
s.timeout = 0
@kimondo
kimondo / email to LEDborg script for Raspberry PI
Created Feb 4, 2013
email to LEDborg script for Raspberry Pi
View email to LEDborg script for Raspberry PI
import imaplib
import email
#connect to gmail
mail = imaplib.IMAP4_SSL('imap.gmail.com')
mail.login('your_email_address@gmail.com','your_password')
mail.select('inbox')
mail.list()