My first app: Is there a Giants game today?

Beard wonders: Is there a Giants game today?

Today is an important day for Bay Area residents. It’s the Giants’ first home game of the season. With the season in full swing, there’s a question on everybody’s mind each day: Is there a Giants game today?

Fans want to know. Anyone taking public transit definitely wants to know.

So my friend and I created a simple app: Is there a Giants game today?

Screenshot of "Is there a Giants game today?"

First home game of the season

It’s our first website side project, and it was fun to create. Check out Laura’s post for the background story. I’ll cover the technical aspects and what we learned.

We worked on it bit by bit, starting with static content and then added the ability for the site to update each day with game information. The code is on GitHub too – fork it and play with it.

What we learned

Keep it simple. Content is minimal. We just answer the question and provide information about today’s game or the next game. No fancy graphics, design or features.

It’s okay to start with a base. There are several Mozilla sites similar to ours that answer a simple question: Are we fast/mobile/pretty/slim/small/first yet? We used their layout and code as a base to get our page working as quickly as possible.

JSON for data storage. Instead of storing the Giants’ schedule in a database, we placed it in a JSON file. This allows all logic to be handled client-side and should make it easier to add offline support later.

JavaScript and jQuery for basic functionality. The page uses jQuery to access the schedule and fill in the content after the page loads. We also learned how to manipulate JavaScript Date objects to find the appropriate game information and format the date for upcoming games.

What’s next?

Improved layout across devices. We’re planning to use LESS so that the page will adapt to various screen sizes. Right now the page looks okay on different devices, but it should be easy to make it even better.

Offline support. Since people don’t always have a data connection on the go, we should make the app work offline too.

hCalendar support. We can use the hCalendar microformat to allow users to always have the next Giants in their favorite calendar app.

Have an idea for making the site better? Submit a pull request or leave a comment.

6 thoughts on “My first app: Is there a Giants game today?

  1. Thank you so much for being incredibly useful! I can’t change my travel schedule, but at least I can be prepared for the onslaught of the kids and their piss beer in the bike car :-)

  2. Absolutely. This site is even more valuable for those affected by Giants home games. Hope your travel is a little bit better now :)

  3. Hi William, love the site and idea! In fact, I loved it so much I forked the project and made http://isthereamarinersgametoday.com.
    :)

  4. Ann, nicely done! You’ve made a lot of Mariners fans very happy :)

  5. This is awesome… but isn’t the real question “is there a Giants home game today”?

  6. Yes, there is! Giants are playing the Reds.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>