Home > network, web > Ruby Help Me to Find a Job

Ruby Help Me to Find a Job

Ruby Help Me to Find a Job

On Indeed:

#!/usr/bin/ruby -w
# Autor: Albertux (Alberto Isaac Ayala Esquivias)
# URL/Blog: http://Albertux.AyalaSoft.com
# E-mail/spam: <albertoi7@gmail.com>
# Free Coke License: If you see me some day give me a free coke please.
# Description: This script maybe help people to find a fucking Job
 
require "rss/2.0"
require "open-uri"
require 'net/http'
require 'rexml/document'
 
# You need to change this values:
keywords = "keyword1+keyword2+keyword3"
zipcode = "10101"
 
def bitly(url)
	# Create account on Bit.ly
	login = ""
	api_key = ""
	data = Net::HTTP.get_response(URI.parse("http://api.bit.ly/v3/shorten?login="+login+"&apiKey="+api_key+"&longUrl="+url+"&format=xml")).body
	doc = REXML::Document.new(data)
	doc.elements.each('response/data/url') do |ele|
		url = ele.text
	end
	url
end
 
open("http://rss.indeed.com/rss?q=" + keywords + "&l=" + zipcode + "&sort=date") do | http |
	response = http.read
	result = RSS::Parser.parse(response, false)
	puts "\nChannel: " + result.channel.title + "\n\n"
	result.items.each_with_index do | item, i|
		puts "#{i+1}. #{item.title} ( " + bitly(item.link) +" )"
	end
end

On Craigslist:

#!/usr/bin/ruby -w
# Autor: Albertux (Alberto Isaac Ayala Esquivias)
# URL/Blog: http://Albertux.AyalaSoft.com
# E-mail/Spam: <albertoi7@gmail.com>
# Free Coke License: If you see me some day give me a free coke please.
# Description: This script maybe help people to find a fucking Job.
 
require "rss/1.0"
require "open-uri"
 
def craigslist_reader(feeds)
	feeds.each do | feed |
		open(feed) do | http |
			response = http.read
			result = RSS::Parser.parse(response, false)
			puts "\nChannel: " + result.channel.title + "\n\n"
			result.items.each_with_index do | item, i|
				puts "#{i+1}. #{item.title} #{item.link}" if i < 10
			end
		end
	end
end
 
craigslist_feeds = [
		"http://sfbay.craigslist.org/sof/index.rss",
		"http://sfbay.craigslist.org/web/index.rss",
		"http://sfbay.craigslist.org/eng/index.rss",
		"http://sfbay.craigslist.org/cpg/index.rss"
]
 
craigslist_reader(craigslist_feeds)

Categories: network, web Tags: , ,
  1. June 26th, 2010 at 15:37 | #1
    Surfing Firefox 3.6.3 Firefox 3.6.3 on Ubuntu Ubuntu

    Indeed.rb with colors: http://pastebin.com/DzgnzfsK using term-ansicolor

  1. No trackbacks yet.