How to update a counter on a remote server via Ruby?

T

Todd Burch

I have lots of users running my ruby scripts. I have one script in
particular, I am certain, has at least 10,000 people running it. Could
be upwards of 20,000 people running it. Some might run it every day,
others might not run it but once in a while.

So, here's what I want to do.

Each time a user runs this script on his client machine (a PC or Mac
only), I want the script to "notify" my server with the results of its
run. If the script is run and makes 5 widgets, I want the widget
counter
on my server to be updated by 5. Anyone who visits my web site can
then see the "impressive global widget count". Good water cooler
discussion.

I will tell my users this script will do this, but I don't want to
interrupt their workflow with any dialog boxes to click OK, or to be
delayed in their workflow (like waiting for a Java app to start up). It
needs to
be quick, and if there is a problem, it needs to be silent about it and
get over it. For instance, if the person is running offline, I can
save the value for updating the next time around, adding whatever saved
value to the current count.

Because of the enviroment of where this script will run, it will not
have the luxury of using Ruby sockets. I do not want to require users
to download and install the full ruby install, so using, for example,
WIN32OLE or the NET lib is also not an option. (In my case, Ruby is
running as an extenstion to another application, under the covers).

So, with all those restrictions... how can this be done with / from
Ruby?

I do have the ability to post a URL pretty easily. My web programming
skills are infantile at this point. I just need to be pointed in the
right direction and then I can read up on it. I can write a C or C++
exe or bundle to do this if needed - no big deal. I just haven't done
it before. A single cross platform solution (Windows and Mac only)
would be ideal.

Thanks, Todd
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top