HELP : display content from external site in auto-refreshing block??

agentdcooper - October 12, 2008 - 11:35

Hello all,

I've been a lurker for a while, figured now is the time to post my question - hope someone can help me out here...

I am attempting to create a "dashboard" solution for my main page on my Drupal 6.4 site. I want to take data from another Intranet site we have at work - this "data" I want to grab is continuously updating, it changes once every 2+mins. I want to grab this small amount of data, and display it in a block (I say block, but it doesn't have to be a block - I just need to display it on my main page somewhere) - here's the tricky part that I am having a heck of a time figuring out.... I want the data/BLOCK to refresh about once every 2-4 minutes, WITHOUT the end-user having to hit REFRESH to refresh the entire "dashboard" page.

I am thinking this needs to be done with AJAX somehow, and I am brand new to AJAX/Javascripting. I suspect jQuery or AJAX is the solution here, but I just dont know HOW to implement it...

For the sake of presenting an example - here it goes: The code from the Intranet site I want to grab is a basic TIMESTAMP - i.e. "the current time IS xx:xx:xx on October xx, 200x" - also further down the page I want to grab some other data - i.e. "Currently 28 trouble tickets are open", and lastly "5 tickets were created in the last 1hour".

That is pretty much the gist of the data I am trying to grab, I then want to format this data into a "drupal block" (I assume) and have the block go out and pull the new TIMESTAMP, # of TICKETS OPEN, and # of TICKETS OPENED IN 1HOUR information and display it with some form of formating - and last but not least, then have this block UPDATE/REFRESH on it's own, independent of the other blocks and information being displayed on the rest of the dashboard webpage. From my searching it sounds like I need to present the data using AJAX, which will only refresh the "block" but not the entire webpage.

Can someone point me in the right direction here? Or better yet, if you have done this before - show me some example code. I will be forever in yr debt! Thanks much -

agentdcooper

The jstools module has

dman - October 12, 2008 - 12:10

The jstools module has dynamic block - which takes care of the refresh AJAX for a few examples. You can try that or learn from it.
Producing the exact data feed is a your job, so I'm not sure the best way to do that.
Have a go.

.dan.
if you are asking a question you think should be documented, please provide a link to the handbook where you think the answer should be found.
| http://www.coders.co.nz/ |

I saw that too, but when I

agentdcooper - October 13, 2008 - 05:28

I saw that too, but when I grab jstools (I am running Drupal 6.4 right now - upgrading to 6.5 soon) it says in README.TXT ;;

As of Drupal 6, Javascript Tools is a small helper module containing methods useful to other Drupal modules using Javascript. Modules formerly distributed with Javascript Tools are being moved selectively to their own projects for separate download.

Looking at the Java Tools Module website = http://drupal.org/project/jstools I see this ;

There are no current plans to update the following to Drupal 6:
[...] [...] [...]
Dynamic load: Some portions of this may be brought into more focused modules.

========================
I couldn't find the page for the module "Dynamic load" or "dynamic block" that has a Drupal 6.x module available... I also found the block refresh module which sounds like it'd do half of I am looking for = http://drupal.org/project/block_refresh but there's only a 5.x-1.x-dev version available, nothing for Drupal 6.x =(

Any other suggestions? I'd love to get this idea off the ground, I am still new to Drupal (been running it since 4.x) in a developer/coding sense.

nobody does this in drupal

agentdcooper - October 15, 2008 - 11:44

nobody does this in drupal 6.x? I am currently using cron to launch a script which downloads the specific data I want and stores it to a text file, then I am using some PHP in a drupal node to display it... I really dislike using the NODE to display this information as it takes up the entire page, not really what i was looking for... I'd love to do this in a BLOCK which auto-refreshes, anybody out there to point me in the right direction? Google/Drupal/D.G.O searches are not helping me anymore, I think I've seen every page 10x that has to do with this --- just not finding anything for drupal 6.x

peace-

 
 

Drupal is a registered trademark of Dries Buytaert.