programtically select javascript link

R

rembi

I am running a service (sourceforge.net/projects/statfink/ ) that
pulls and displays fantasy football statistics. One of the
limitations is that it only pulls stats for games that are active or
completed at the time a specific button on the server is selected.
This button calls a javascript function. I'm looking for a method to
select that button from an application started periodically through a
cron task. Any suggestions?
 
P

pr

rembi said:
I am running a service (sourceforge.net/projects/statfink/ ) that
pulls and displays fantasy football statistics. One of the
limitations is that it only pulls stats for games that are active or
completed at the time a specific button on the server is selected.
This button calls a javascript function. I'm looking for a method to
select that button from an application started periodically through a
cron task. Any suggestions?

Please explain again. The way I read it, you want to run a browser-based
application from a cron task. That can't be right. Where is this 'button
on the server' and who selects it?
 
R

rembi

Please explain again. The way I read it, you want to run a browser-based
application from a cron task. That can't be right. Where is this 'button
on the server' and who selects it?

Ok, let me approach this from a different angle...A visit a webpage
that provides a service to me--by service, I simply mean that it
performs an action that I am interested in. To receive that service,
all I have to do is click a button. The button click initiates a call
to some javascript which completes the service. What I would like to
do is programatically simulate the "click", or to say it differently,
initiate the action specified by the <a href=...> or onclick(...)
tags. I've seen a perl package that comes close
(WWW::Mechanize)...but it doesn't support javascript.

Does that help?
 
P

pr

rembi said:
Ok, let me approach this from a different angle...A visit a webpage
that provides a service to me--by service, I simply mean that it
performs an action that I am interested in. To receive that service,
all I have to do is click a button. The button click initiates a call
to some javascript which completes the service. What I would like to
do is programatically simulate the "click", or to say it differently,
initiate the action specified by the <a href=...> or onclick(...)
tags. I've seen a perl package that comes close
(WWW::Mechanize)...but it doesn't support javascript.

Does that help?

Yes, it does. I don't think you'll have any luck adapting a
browser-based javascript application for use in a cron task, but you can
mimic the browser's HTTP output very simply from a command line script.

If you don't want to, or can't use the PHP command line interface to
send/receive HTTP, then think about Wget
(http://www.gnu.org/software/wget/). It's primarily a download utility,
but it can send different headers, including POST (for forms), and save
any results to file. You can automate it using a standard shell script.

HTTP itself isn't very hard to understand; an Ajax tutorial might tell
you as much as you need to know. A quick way to find out what the
browser is saying to the server is to use a traffic analyser like
Wireshark (http://www.wireshark.org/), or Firefox's 'Live HTTP Headers'
extension (http://livehttpheaders.mozdev.org/).
 

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
474,156
Messages
2,570,878
Members
47,404
Latest member
PerryRutt

Latest Threads

Top