Skip to content

Instantly share code, notes, and snippets.

@Celeo
Celeo / pyg.py
Last active September 18, 2015 21:40 — forked from Synthetica9/pyg.py
An interpeter for pyg, the golfed python. Fully backwards compatible with python.
# A golfed python 'accent'. Fully backwards compatible with python.
# NOT SUITED FOR DAY-TO-DAY PROGRAMMING!
# If you DO use it for a production (non-challenge/codegolf) program, I'm not
# responsible for anything bad that happens to you, your computer,
# your spare time, your code maintainability, any kittens that god might kill,
# or the tears of blood you will weep.
import sys
from math import *
package seronis.testing;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.io.IOException;
@Celeo
Celeo / gist:6127556
Last active December 20, 2015 11:59
Uses the evelink library to show what information is visible for a character given an api key, code, and the character's name.
import evelink, urllib2, sys
from colorama import init, Fore
print 'Setting up console output ...'
init(autoreset = True)
r = Fore.RED
g = Fore.GREEN
w = Fore.WHITE
b = Fore.CYAN
@Celeo
Celeo / checkprereqs.py
Created August 8, 2013 19:43
Another Python EVE API script. Here, we check for a file called api.txt where the user places a series of api keys, codes, and character names for checking. The code is launched with as many checks as needed, and then loops through all characters and all checks to determine who does not have the specified skills and the appropriate level.
"""
Reads from a file called api.txt in the same director as this script. That file should be setup in the manner of
keyID,vCode,Character Name
keyID,vCode,Character Name
keyID,vCode,Character Name
keyID,vCode,Character Name
for as many lines as you wish to be checked.
This script is then ran with the following parameters:
@Celeo
Celeo / RedditCommentFetcher
Last active December 25, 2015 17:28
Uses PRAW to fetch a user's comment and write to a file.
import praw
from datetime import datetime
utc_now = datetime.utcnow()
def main():
username = raw_input('Username: ')
password = raw_input('Password: ')
limit = raw_input('Fetch limit: ')
limit = int(limit)
@Celeo
Celeo / queensdale_zerg.py
Created November 27, 2013 04:28
Use GuildWars2's API to show which event in the Queensdale map champion zerg chain players are participating in.
import sys
import urllib2
import json
from time import sleep
def get_all_current_events():
ret = [x for x in json.loads(urllib2.urlopen('https://api.guildwars2.com/v1/events.json?world_id=1021&map_id=15&lang=en').read())['events']]
return ret
def is_zerg_event(event_id):
@Celeo
Celeo / cpu_usage_render.py
Created December 5, 2013 02:04
Uses Pygal and Psutil to create a graph of CPU usage over 60 seconds.
import psutil
import pygal
from time import sleep
c = pygal.Line()
c.title = 'CPU Usage Over 1 Minute'
data = []
count = 0
print 'Starting ...'
while True:
@Celeo
Celeo / corp_POS_fuel.py
Created January 10, 2014 02:54
Use evelink to determine time all corp POSs run out of fuel
import evelink
from datetime import datetime
eve = evelink.eve.EVE()
char_id = eve.character_id_from_name(raw_input('Enter your character name: '))
api = evelink.api.API(api_key=(raw_input('Key ID: '), raw_input('vCode: ')))
char = evelink.char.Char(char_id=char_id, api=api)
events = char.calendar_events()
print ''
@Celeo
Celeo / corp_POS_fuels_eveapi.py
Last active January 2, 2016 18:49
Use eveapi to determine time all corp POSs run out of fuel
import eveapi
from datetime import datetime
api = eveapi.EVEAPIConnection()
auth = api.auth(keyID=raw_input('Key ID: '), vCode=raw_input('vCode: '))
events = auth.char.UpcomingCalendarEvents()
print ''
for event in events.upcomingEvents:
@Celeo
Celeo / corp_applicant_notifications.py
Last active January 3, 2016 07:19
Uses the character's notification system to determine if there are any new applications to their corporation.
import eveapi
from datetime import datetime
api = eveapi.EVEAPIConnection()
def main():
auth = api.auth(keyID=raw_input('keyID: '), vCode=raw_input('vCode: '))
characterID = raw_input("Your Director/CEO's character name: ")
notifications = auth.char.Notifications(characterID=characterID)
applicants = []