feedback wanted on caltrain.app - my first app

51 views
Skip to first unread message

Jesse

unread,
Jul 22, 2007, 8:12:05 PM7/22/07
to iPhoneWebDev
I've just finished my first iPhone specific web app: caltrain schedule

it's available at http://caltrainapp.com

some details:

- parsing the html tables from http://caltrain.com/timetable.html was
the hardest part because they aren't valid/well formed. (usually they
have times between as 1:00, for both 1am and 1pm, as well as an
occasional 13:XX and other oddities.

- all the pages are pre-built: resulting in 6MB of html, and 1465
files.

- built in ruby, using erb

- created links to google maps (which pop up in the maps app) -
moviesapp.com used a string &oi=movies - anyone know what this is?

---

I hope to move from iUI to a more suitable UI (not that iUI isn't
good, but it isn't rich enough for the types of pages I need). Plus
bookmarkability would be nice ;)

If anyone is interested I'll release the source under the GPL

Jesse

ps: There are hunks of (elisp?) code in comments of the timetable page
on caltrain.com -- good to know lispers use errors like foo as well :p

(while (re-search-forward "</th><td" nil t)
(backward-char 3)
(save-restriction
(narrow-to-region (point) (progn (end-of-line) (point)))
(goto-char (point-min))
(let ((s '(1 1 3 2 3 2 3 2 2 3 2 3 2 2 3 2 2 1 2 1 2 1 2 1 2 1
2 1 2 1 2 2 3 2 3 2 3 2 2 3 2 3 2 2 1 1 1 1 )))
(while s
(re-search-forward "\\(<td[^<>\n]*>\\)\\([^\n<>]*</td>\
\)")
(replace-match (format "\\1<!%s-%d%s->\\2" "-" (car s)
"-"))
(setq s (cdr s)))
(or (looking-at "</tr>") (error "Foo")))))

drudru

unread,
Jul 23, 2007, 6:19:46 AM7/23/07
to iPhoneWebDev

Great stuff. Tried it out and it worked fine over edge.

You should check out http://munitime.com/ for a similar app.

cheers

oh yeah, love the lisp find. Awesome!


Ido Green

unread,
Jul 23, 2007, 1:58:22 PM7/23/07
to iPhoneWebDev
Nice!
Good work... I think you might want to let the user set their 'home'
station?


On Jul 22, 5:12 pm, Jesse <anotherje...@gmail.com> wrote:
> I've just finished my first iPhone specific web app: caltrain schedule
>

> it's available athttp://caltrainapp.com

Jesse

unread,
Jul 23, 2007, 5:15:52 PM7/23/07
to iPhoneWebDev
For a home station do you think that storing it in a cookie is
enough? or should I allow setting a home by choosing a station and
then bookmarking it (eg that page becomes the homepage with all the
details about travel from that location)

Jesse

Josh Tyler

unread,
Jul 25, 2007, 12:35:42 PM7/25/07
to iPhoneWebDev
I like it.

I also like the idea of bookmarking a home station. Then you don't
have to worry about session lengths, cookies, clearing the cache,
etc. Is there a javascript hook to set a bookmark, something like
window.external.AddFavorite for IE? Then you could have a link, "save
this station."

Ido Green

unread,
Jul 25, 2007, 12:40:55 PM7/25/07
to iPhoneWebDev
Great job.
1. I think allow setting the 'home' station would be clearer to the
users :)
2. Will we see the code (under GPL) in the near future?

Best,
Ido


On Jul 23, 2:15 pm, Jesse <anotherje...@gmail.com> wrote:

mykoleary

unread,
Jul 26, 2007, 10:23:00 AM7/26/07
to iPhoneWebDev
Forget setting the station, etc... Use the "page in a bookmark" hack
presented a few weeks ago and make a link on each end page of stations
that lets a user save the page as a bookmark. That way when Edge goes
down, they can still get to their train schedule.

-Mykoleary

Reply all
Reply to author
Forward
0 new messages