Skip to content

Instantly share code, notes, and snippets.

View coderberry's full-sized avatar

Eric Berry coderberry

View GitHub Profile
# This class takes a name of a movie and gets data from imdb
# Author:: Stephen Becker IV (mailto:sbecker@x.y@gmail )
# Copyright:: Copyright
# License:: Distributes under the same terms as Ruby
# version:: Doctor Zhivago(0.6)
require 'rubygems'
#needs version >= 0.5.00 of hpricot
#works with version 6.0 ruby
require 'hpricot'
require 'open-uri'
# Movie Importer
require 'IMDB.rb'
require 'YAML'
require 'fastercsv'
class Movie
attr_accessor :title, :run_time, :plot, :director, :writer, :link
attr_accessor :release_date, :rating, :user_comments, :tag_line
attr_accessor :plot, :genres, :cast, :poster, :keywords, :mpaa
#!/usr/bin/env ruby
require "rubygems"
require "integrity"
# If you want to add any notifiers, install the gems and then require them here
# For example, to enable the Email notifier: install the gem (from github:
#
# sudo gem install -s http://gems.github.com foca-integrity-email
#
# And then uncomment the following line:
require "openssl"
require "net/smtp"
Net::SMTP.class_eval do
private
def do_start(helodomain, user, secret, authtype)
raise IOError, 'SMTP session already started' if @started
check_auth_args user, secret if user or secret
sock = timeout(@open_timeout) { TCPSocket.open(@address, @port) }
<?xml version="1.0" encoding="UTF-8"?>
<pdl-exchange>
<authentication>
<store>00000000419</store>
<id>00000419</id>
<passphrase>kwidgibo</passphrase>
</authentication>
<applicant>
<supplier-reference-id>49</supplier-reference-id>
<ip-address>127.0.0.1</ip-address>
require 'rubygems'
require 'twitter'
password = File.read(File.join(File.dirname(__FILE__), "password.txt")).strip
httpauth = Twitter::HTTPAuth.new('teachmetocode', password)
client = Twitter::Base.new(httpauth)
followers = client.followers
puts "Out of #{followers.count} followers ..."
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Eric Berry (cavneb) subscriptions in Google Reader</title>
</head>
<body>
<outline text="Build Internet!" title="Build Internet!"
type="rss"
xmlUrl="http://feeds.feedburner.com/buildinternet" htmlUrl="http://buildinternet.com"/>
<outline text="Dilbert Daily Strip" title="Dilbert Daily Strip"
require 'rubygems'
require 'twitter'
require 'ruby-growl'
last_tweet_id = 0
loop do
result = Twitter::Search.new('teachmetocode').since(last_tweet_id).fetch().results.first
if result
from_user = result[:from_user]
<?xml version="1.0" encoding="UTF-8"?>
<order>
<company-id>1</company-id>
<shipping-profile>t1</shipping-profile>
<shipping-full-name>John Doe</shipping-full-name>
<shipping-care-of/>
<shipping-address-1>123 Easy St</shipping-address-1>
<shipping-address-2/>
<shipping-city>Eau Claire</shipping-city>
<shipping-state>WI</shipping-state>
require 'net/http'
require 'uri'
# Create te http object
url = "http://POST_URL_HERE/api/create_custom_order"
uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port)
xml = <<-EOF
<order>