By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,975 Members | 1,202 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,975 IT Pros & Developers. It's quick & easy.

programtically select javascript link

P: n/a
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?

Sep 27 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
pr
rembi wrote:
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?
Sep 27 '07 #2

P: n/a
On Sep 27, 1:09 pm, pr <p...@porl.globalnet.co.ukwrote:
rembi wrote:
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?
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?

Sep 28 '07 #3

P: n/a
pr
rembi wrote:
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/).
Sep 29 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.