Re: n00b question



Hi,

Miles Chatterji wrote:
somewhat new to ruby, and im trying to write a simple program to print
[IMG] tags for php forums on my screen so I dont have to copy and paste
100 of them and change the pictures number every time. Example I have
127 pictures from a race that I would like to post, the tag is
[img]http://www.empiremotoring.org/pictures/pp.5.17.08/IMG_0987.jpg[/img]
and I would like the program to list the next one as
[img]http://www.empiremotoring.org/pictures/pp.5.17.08/IMG_0989.jpg[/img]
[img]http://www.empiremotoring.org/pictures/pp.5.17.08/IMG_0990.jpg[/img]

and so on, this is what I have so far, I am just having trouble getting
it add +1 to the end ever time because it dosent like numbers in the
string, I have tried several things but non of which worked out. Any
advice would be a great help here is the code

# Img forum tag lister



puts "What is your url: " # url from input
url = gets.chomp

puts "What is your files name: " # file name from input (IMG_ for canon
DSC_ for sony etc.)
file = gets.chomp

puts "How many files: " # # of files wanted to print from input
num = gets.to_i

puts "beginning file #: " # beginning number extension, ( number at end
of picture file eg IMG_0987, would be 0987)

bnum = gets.chomp

print ("[img]" + url + file + bnum.to_s +=1 + ".jpg [/img]") *num.to_i
try this:

num.times { puts "[img]#{url}#{file}#{bnum=bnum.succ}.jpg[/img]" }


I realize that you can put the numbers into a sting without first
converting but the how would you go about having it add +1 after it has
been converted?

Thanks, --Miles

Regards,
Park Heesob
--
Posted via http://www.ruby-forum.com/.

.



Relevant Pages

  • n00b question
    ... tags for php forums on my screen so I dont have to copy and paste ... 100 of them and change the pictures number every time. ... 127 pictures from a race that I would like to post, the tag is ... converting but the how would you go about having it add +1 after it has ...
    (comp.lang.ruby)
  • Re: n00b question
    ... tags for php forums on my screen so I dont have to copy and paste ... 100 of them and change the pictures number every time. ... 127 pictures from a race that I would like to post, the tag is ...
    (comp.lang.ruby)
  • Re: help with Photo gallery please - Follow-up Question
    ... You could however try the Group By tag or Sort By tag features in Gallery ... Then save that search in your Searches folder, give it a good name like ... "Trebor chill'n" where Trebor is all the pictures of Trebor and chill'n is ... This would include any photos that you have ...
    (microsoft.public.windows.vista.general)
  • Re: find lost jpegs
    ... exiftags is one way of getting the exif tag information in a text format. ... change the "Unique Image ID" tag then you could do something like this. ... Putting the above command into the command that searches the Pictures ...
    (comp.unix.shell)
  • Re: Warehouse Raid Pictures
    ... i'm hoping someday to tag along to one of these even if ... man that would be a blast! ... I won't save a game for you that you see in the pictures ... 15-20 gun games ...
    (rec.games.pinball)