Forum: Ruby Rube newb: What is the term for this?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
530ba7fd43261663b70918619ec0d93a?d=identicon&s=25 Sam Wilson (Guest)
on 2009-01-13 07:17
(Received via mailing list)
I'm learning Ruby, I'm sorry if this question is stupid.

Let's say a have a blog. Can Ruby do some operations to the database
let's say once a day. Just for imagination's sake let's say the
operation would be to create a new post that inputs standard info like
"I like turtles today!" and it does this every day. But it doesn't
require a person to visit the site to happen.

What's this kind of operation called and is it a pain in the neck to
make work?
0026dd77fd9ecc97b36e5b79cdbcf590?d=identicon&s=25 R. Kumar (sentinel)
on 2009-01-13 08:03
Sam Wilson wrote:
> I'm learning Ruby, I'm sorry if this question is stupid.
>
> Let's say a have a blog. Can Ruby do some operations to the database
> let's say once a day. Just for imagination's sake let's say the
> operation would be to create a new post that inputs standard info like
> "I like turtles today!" and it does this every day. But it doesn't
> require a person to visit the site to happen.
>
> What's this kind of operation called and is it a pain in the neck to
> make work?
What you want is a job/cron job, background process, daemon ..

Any language that can write into your blogs database will do. Even a
shell script could work. With ruby you can use Ruby DBI or some other
mapper of your choice to insert into the database.

Then create an entry in your crontab file (crontab -e) and put the time
for when you want the script to run.

Depending on your blog software you may also consider posting to your
blog rather than writing to the database. Check mtsend.py as an example
(there are ruby versions also, cant recall, for writing to wordpress and
other blogs).

hth
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2009-01-13 16:26
(Received via mailing list)
Ruby Rabbit wrote:

>> Let's say a have a blog. Can Ruby do some operations to the database
>> let's say once a day...

> What you want is a job/cron job, background process, daemon ..

RR forgot the disclaimer: Ruby is a language, and this is very probably
a
question about Ruby on Rails, which is a platform. Further questions
about Rails
will get the best answer on its Google Group...
This topic is locked and can not be replied to.