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

**URL:** <https://www.ruby-forum.com/t/how-to-update-a-counter-on-a-remote-server-via-ruby/117098>\
**Category:** Ruby\
**Created:** [October 12, 2007, 11:56pm UTC](https://www.ruby-forum.com/t/how-to-update-a-counter-on-a-remote-server-via-ruby/117098 "2007-10-12T23:56:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![toadkicker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/5fc32e/32.png) [@toadkicker](https://www.ruby-forum.com/u/toadkicker)\
**Post date:** [October 12, 2007, 11:56pm UTC](https://www.ruby-forum.com/t/how-to-update-a-counter-on-a-remote-server-via-ruby/117098/1 "2007-10-12T23:56:42Z")

</div>

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
