[TIMELINE] How to get data events from mysql database???

384 views
Skip to first unread message

Zulkifli Said

unread,
Jan 21, 2012, 3:19:05 AM1/21/12
to simile-...@googlegroups.com
hello, i ask to you... i'm using timeline simile, i want to get data events from mysql database. and i can't do it.
please give me an example how to display data event  from mysql database to  timeline simile???
thanks before...

Contemplative

unread,
Jan 22, 2012, 4:48:14 PM1/22/12
to simile-...@googlegroups.com
I have done this for work but can not provide an example.  However, following are the basics of what I did to accomplish what you are talking about:
Environment:
  • IIS web server
  • Perl CGI
  • Perl DBI
  • Simile Timeline 2.x
  1. Configure timeline as you wish it to appear
  2. write script to retrieve data from mysql DB (I used form data to let the user select a range of data; 1 day, 1 hour, 1 week...etc)
  3. write subroutine in above script to process retrieved data into JSON
  4. write subroutine to deliver the resulting JSON to the timeline
The Timeline simply calls the CGI script which runs the query, builds the JSON and streams it back to the Timeline.  I do this for exhibits as
well.  In the head of the html page that contains the Timeline/Exhibit, the following line calls the cgi script which does the back end work with 
the database and JSON generation:
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> <link href="/cgi-bin/ct_get_data.cgi?query=cc" rel="exhibit/data" type="application/json" />

Note that the name of the script which does the work in the above is ct_get_data.cgi.

While I am using Perl to do the back end work, anything that can connect to your DB will do just fine as long as
it runs on your web server. (Many use PHP for this type of work, but ruby, python...whatever will do.

Hope that helps.

martin

unread,
Jan 23, 2012, 2:20:46 PM1/23/12
to SIMILE Widgets
I have detailed the php code on this post:
http://groups.google.com/group/simile-widgets/browse_thread/thread/a67fd326fab35d9/2159be995fc98476?lnk=gst&q=martin#2159be995fc98476
the test pages are down but there is a real world example that is
currently in use using that little bit of code:
http://www.comoxvalleycrimestoppers.bc.ca/index.php?page=crimemap
it populates the map as well as other pages
Reply all
Reply to author
Forward
0 new messages