Rubyfags (5)

1 Name: #!/usr/bin/anonymous : 2008-11-07 07:28 ID:Heaven

Ruby - best programming language.
Discuss.

2 Name: #!/usr/bin/anonymous : 2008-11-07 11:37 ID:Heaven

reported

3 Name: #!/usr/bin/anonymous : 2008-11-09 19:18 ID:eS56b9L+

second!
Let's post random ruby code, that you have in you .rb files

#puts "Write your website with images to here, Please." 
website = "img.7chan.org/wp/res/3369.html#"
##################### 
# JPG #
#####################
require 'open-uri'
favorites = []
open("fun.TXT","w").write(open("http://" + website.to_s).read)
File.read("fun.TXT").scan(/<img src="(.*jpg)"/) { |x| favorites.push x }
File.delete("fun.TXT")
puts "WE FOUND :" 
if favorites[0] == nil
puts "No jpg here!"
else
puts favorites
puts "DOWNLOADING " + favorites.length.to_s + " Files"
listnumber = 0
picnumber = 1
while favorites[listnumber] != nil
open("jpg"+picnumber.to_s+".jpg","w").write(open(favorites[listnumber].to_s).read)
puts "DONE " + picnumber.to_s
picnumber = picnumber + 1
listnumber = listnumber + 1
end
end
#####################
# GIF #
#####################
require 'open-uri'
favorites = []
open("fun.TXT","w").write(open("http://" + website.to_s).read)
File.read("fun.TXT").scan(/<img src="(.*gif)"/) { |x| favorites.push x }
File.delete("fun.TXT")
puts "WE FOUND :" 
if favorites[0] == nil
puts "No gif here!"
else
puts favorites
giffavorites = favorites.length - 1
puts "DOWNLOADING " + giffavorites.to_s + " Files"
listnumber = 1
picnumber = 1
while favorites[listnumber] != nil
open("gif"+picnumber.to_s+".gif","w").write(open(favorites[listnumber].to_s).read)
puts "DONE " + picnumber.to_s
picnumber = picnumber + 1
listnumber = listnumber + 1
end
end
#####################
# PNG #
#####################
require 'open-uri'
favorites = []
open("fun.TXT","w").write(open("http://" + website.to_s).read)
File.read("fun.TXT").scan(/<img src="(.*png)"/) { |x| favorites.push x }
File.delete("fun.TXT")
puts "WE FOUND :" 
if favorites[0] == nil
puts "No png here!"
else
puts favorites
puts "DOWNLOADING " + favorites.length.to_s + " Files"
listnumber = 0
picnumber = 1
while favorites[listnumber] != nil
open("png"+picnumber.to_s+".png","w").write(open(favorites[listnumber].to_s).read)
puts "DONE " + picnumber.to_s
picnumber = picnumber + 1
listnumber = listnumber + 1
end
end

4 Name: #!/usr/bin/anonymous : 2008-11-10 01:13 ID:Heaven

Ruby: Perl, but with marginally less punctuation.

5 Name: #!/usr/bin/anonymous : 2008-11-10 11:39 ID:Heaven

Ruby - the weeaboo way of programming.

puts "its like im really japanese\n"

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: