Skip to content

Instantly share code, notes, and snippets.

View LyndonArmitage's full-sized avatar

Lyndon Armitage LyndonArmitage

View GitHub Profile
@LyndonArmitage
LyndonArmitage / clock.html
Created June 30, 2013 14:55
The HTML5 file for the analog clock
<!DOCTYPE html>
<html>
<head>
<title>Clock</title>
<style type="text/css">
#container {
margin: 0 auto;
width: 800px;
text-align: center;
border: black dashed 1px;
@LyndonArmitage
LyndonArmitage / planetside_events.py
Created May 23, 2013 18:15
A Planetside 2 Python bot that periodically told me what the last event was that happened on the server I play on via a text to speech engine called pyttsx and prints it to the console.
import requests
import pyttsx
import time
__author__ = 'Lyndon'
# SOE documentation: https://census.soe.com/
# Faction IDs
def get_faction(id):
@LyndonArmitage
LyndonArmitage / planetside_certs.py
Created May 23, 2013 18:11
This is a basic python script to check the average cert gained per minute on Planetside 2 using their API.
import requests
import time
__author__ = "Lyndon Armitage"
check_interval = 60 * 1 # Every 1 min
interval = 60 * 1 # Interval to sleep at (can be faster than check interval)
last_check_time = time.clock() - check_interval
username = "theanchorman"
start_certs = 0
@LyndonArmitage
LyndonArmitage / gist:5224257
Created March 22, 2013 19:55
Speak the top news from reddit. Runs in an infinite loop. Quite messy code, makes use of 3 different libraries.
package com.lyndonarmitage.reddit;
import com.omrlnr.jreddit.submissions.Submission;
import com.omrlnr.jreddit.submissions.Submissions;
import com.omrlnr.jreddit.user.User;
import com.sun.speech.freetts.VoiceManager;
import org.joda.time.DateTime;
import org.joda.time.LocalDateTime;
import org.joda.time.LocalTime;
import org.joda.time.Period;
@LyndonArmitage
LyndonArmitage / redditSpeak.py
Created March 9, 2013 18:47
My first Python program. Gets the top 10 news stories from Reddits worldnews subreddit and speaks them out using a Text to Speech engine.
import time
import praw
import pyttsx
__author__ = "Lyndon Armitage"
username = "alarmbot"
password = "password"
engine = pyttsx.init()