Rube newb: What is the term for this?

S

Sam Wilson

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?
 
R

Ruby Rabbit

Sam said:
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
 
P

Phlip

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top