Skip to content

Instantly share code, notes, and snippets.

View rharjes's full-sized avatar

Rob Harjes rharjes

  • Minneapolis, MN
View GitHub Profile
@rharjes
rharjes / FbConsole.rb
Created June 8, 2011 18:40
Simplified Facebook interactions/navigation via Ruby/Mechanize.
#####################################################################
# Simplified Facebook interactions/navigation via Ruby/Mechanize. #
# Author: Robbie Harjes #
# Date: 6/8/2011 #
# Notes: Not liable for misuse; free for non-commercial projects.#
# This notice must remain intact if you use this code. #
#####################################################################
@rharjes
rharjes / spider.rb
Created June 9, 2011 00:53
Using FbConsole (Ruby/Mechanize/Nokogiri) to crawl your facebook friends' profiles
require 'benchmark'
$count = 0
def to_the_end(agent)
# Check if we have bottomed out (no more sub-category links)
if agent.page.at("#sections/div[@class='acw apm']/span[@class='mfss fcg']").nil?
# Find the unique identifier (a friend's name), which we'll use to find their profile links
@rharjes
rharjes / PhotoMosaicBuilder.cpp
Created June 10, 2011 01:32
Proof-of-concept photo mosaic builder (kinda fragile at the moment)
// Photo Mosaic builder
// Author: Robbie Harjes
// Date: 6/9/2011
// Notes: Free for non-commercial projects. This notice must
// remain intact if you use this code.
// 1. Image library (directory) is loaded from first command-line argument
// This argument needs to end with: \* to work correctly.
// Images need to be 50x50 pixels.
// 2. This will only work on Windows (directory searching)