Skip to content

Instantly share code, notes, and snippets.

View petermuller's full-sized avatar

Peter Muller petermuller

View GitHub Profile
@petermuller
petermuller / facebookScraper.py
Created February 13, 2014 07:38
Finds and prints the JSON object of each valid Facebook user whose ID number falls below the number in the range. Adjust range to match your patience level, and import JSON libraries for parsing and doing more complex things with the data. Assumes Python 2.7.x and cURL.
#!/usr/bin/python
import subprocess
objects=[]
for i in range(1000):
output = subprocess.check_output("curl https://graph.facebook.com/" + str(i),shell=True)
if not "\"code\":100" in output:
objects.append(output)
for each in objects:
@petermuller
petermuller / trees.py
Created July 6, 2013 00:42
You are never too old for turtle... Recommended values are 8 for depth and 100 for length. This is just a simple script to show how recursion can be used for drawings. Feel free to edit angles and shapes for your own use.
#!/usr/bin/python
"""
trees.py
Recursion!
"""
from turtle import *
import random
@petermuller
petermuller / primeGen.py
Created July 5, 2013 01:43
Brute-force prime number generator. Starting with two known beginning prime numbers, more can be generated indefinitely.
"""
primes.py
Peter Muller
Generates and prints prime numbers after 2 until
you kill the program with Ctrl + C
Works by checking to see if a number is divisible by any other number in
the list of prime numbers. If not, it is prime and added to the list of
prime numbers to check future numbers against.