Learning ActionScript 3.0

When I set out to learn a new programming language, I usually take baby steps:

  • Read as much as possible about the language
  • Find the experts online and see what they’re saying/doing
  • Find and work through beginner tutorials
  • Come up with an idea to build something on my own

It usually takes a good 3 months or so before I get to that last step.

I didn’t get that luxury with AS3. A few weeks ago, I started watching the AS3 tutorials at Lynda.com. I had been assigned to rebuild The Miami Herald’s 60 Seconds project.
The current project is written in AS2. All the bits and pieces are internal. My mission was to rebuild it in AS3 and make it load information from an XML file so that it could be updated easily.

I started out with a series of classes: one to load the XML, one to parse it, one to define the thumbnails, etc. These classes were refined and rewritten until I got the thumbnails to load into the screen, much as they do in the original version.

It’s taken me 3 weeks to get that far. Google is my best friend. The next few steps:

  • fix interface so that when more videos are added, the screen will scroll left and right to show the additional videos
  • clicking on a thumbnail will go to large version of video with description etc, pulled from XML
  • add commenting, feedback and rating functionality

Right now, I can’t even begin to figure out how that’s going to get done. But it will, and I’ll learn a lot from the experience.

Check my Del.icio.us bookmarks for AS3 resources.

Bandwagon of the summer: News APIs

In May announced its intention to build an Application Programming Interface for its data. MediaBistro quoted Aron Pilhofer:

The goal, according to Aron Pilhofer, editor of interactive news, is to “make the NYT programmable. Everything we produce should be organized data.”

More details, if they can be called that:

Once the API is complete, the Times’ internal developers will use it to build platforms to organize all the structured data such as events listings, restaurants reviews, recipes, etc. They will offer a key to programmers, developers and others who are interested in mashing-up various data sets on the site. “The plan is definitely to open [the code] up,” Frons said. “How far we don’t know.”

I haven’t heard anything since then, although the article mentioned that something would be ready “in a matter of weeks.”

Today I spent some time reading the API documentation for National Public Radio.

That’s right, NPR has an API. (mmm, I love my alphabet soup.)

NPR’s API provides a flexible, powerful way to access your favorite NPR content, including audio from most NPR programs dating back to 1995 as well as text, images and other web-only content from NPR and NPR member stations. This archive consists of over 250,000 stories that are grouped into more than 5,000 different aggregations.

You can get results from Topics, Music Genres, Programs, Bios, Music Artists, Columns and Series in XML, RSS, MediaRSS, JSON, and Atom or through HTML and JavaScript widgets.

Now, I’m a bit of an NPR junkie, so I’m thinking of ways to access all this information for my personal use. And I can see how it could be useful as an internal product for NPR.

But how would another news organization use this? Oh wait, they can’t:

The API is for personal, non-commercial use, or for noncommercial online use by a nonprofit corporation which is exempt from federal income taxes under Section 501(c)(3) of the Internal Revenue Code.

This one doesn’t make sense either:

Content from the API must be used for non-promotional, internet-based purposes only. Uses can include desktop gadgets, blog posts and widgets, but must not include e-newsletters.

And way down at the bottom of the page is a huge block of text describing excluded content. Boooo.

Check out these blog posts from Inside NPR.org, where they explain some of their decisions.

I think this was a great first step, but if you’re gonna jump on the bandwagon, make sure you don’t miss and land on the hitch.

cat

Further, really understand what purpose this bandwagon has. If you’re going to free your data, free it! Let people and news organizations use it (always with a link back) for all kinds of crazy things. Remember kids, sharing is caring!

Google Maps update

For the last month or so I’ve been taking a really in-depth look at the Google Maps API. Partly out of my own curiosity, and partly as an individual project for the online capstone course at UF.

I’ve learned some really cool things along the way. How to work with information flowing between a viewer and the server, for instance. I’ve also learned more about javascript and PHP.

One bad thing though: Google Maps tend to fail when you need to plot more than 200 locations. Ken Schwencke and I found this out when we tried to plot over 800 Gainesville restaurants with their inspection reports from an XML file. We’re still looking for a solution. (We’ve basically parsed a CSV file with python and gotten it to feed into an XML file which is being fed into the map…now I’m hungry.)

We wanted to integrate restaurant reviews using the Yelp API, but the requests are restricted to only 20 businesses, so we’re working on our own review backend.

For my class project, I’m building a map with multiple layers, like crime, alcohol licenses, and restaurant inspections, that can be toggled to show only the information a viewer wants to see. Or all of it at once. It’ll be on a small scale, just as a proof of concept. But still pretty cool.

Project Updates: Django

After 2 frustrating months, I finally got Django up and running on my laptop. I could have had an easier time installing it on my Windoze machine, but I’m not home very much, so I wouldn’t have time to play with it.

Ken Schwencke, whose help was instrumental in finally get Django to work, and I have been working through the tutorials on the Django project Web site. It’s time to buy some python programming books.

Ken is a few steps ahead of me, having already written a python script to parse a Twitter friends feed so it can be printed out in plan text. (We discovered GeekTool recently, and have been experimenting with getting all kinds of data printed to the desktop.)

I’m really excited about learning how to use Django and python to build new web projects.

(J)journalist/(P)programmer

Two recent events set off a discussion among the journalists whose blogs I read to the effect of: Do journalists need to be programmers?

Adrian Holovaty got a grant to go off and spend his days working on EveryBlock, and Northwestern University got a grant to provide scholarships to computer programmers who want to learn journalism.

Of course, this discussion has occurred in classrooms and newsrooms already, but this was the first explosion on the subject online. At the root, the problem is that in order to create great online content, SOMEONE in the newsroom needs to be able to work with databases (PHP), ActionScript (Flash), and CSS. But newspapers aren’t hiring, or programmers don’t get involved in journalism, or something occurs that prevents the newsroom from having access to someone who can write some code.

Here are some of the opinions that have appeared:

(A lot of people are differentiating between Programmers and programmers, Writers and writers. That’s why I use upper- and lower-cases differently.)

Matt Waite: In 2 separate posts, Matt explains the reasons newsrooms need programmers and who should/shouldn’t be learning it. His position is not that all journalists should learn to code, but that the people who have an interest in both writing and programming can bring more to the table. Ultimately, “Journalism needs all the innovators it can get.”

David Cohn: David, clearly on the side of journalists learning to code, asks where the scholarships are to teach journalists to program, and points out that the hot players in geek journalism are journalists turned coders, not the other way around.

Dan Gilmor: Journalists don’t need to learn to program, they need to learn how to work with programmers.

William Hartnett: “Journalists need to know programming. Not all of us, but some.” He differentiates between Programming and programming, and argues that some programming can be considered journalistic tasks, “clean up dirty personnel records from the school district or parse some messy addresses in crime data from the sheriff’s office.”

Scott Rosenberg: Scott supports the idea of journalists learning programming, but they don’t need to Program. More important, they need to understand the technology available for storytelling online.

Howard Owens: Howard is a journalist/programmer himself. But he recommends that journalists learn new skills that compliment their talents and individual situations. And these new skills should be applicable online. In a later update, Howard says the instead of all running off to learn to code, journalists should “figure out the niche your employer needs filled, and fill it.”

To me, online journalism encompasses all of the aspects of the Internet, be it code or multimedia. I’m not sure you can call yourself an Online Journalist if your Web page is all HTML tables and a few lines of PHP make you quiver like Jell-o. If you don’t feel comfortable writing code from scratch, you should at least be able to edit it.

I’m definitely in favor of a scholarship for journalist/programmers and programmer/journalists. I feel like some journalism students are afraid to learn code because it is associated with, or feels like, math. I’m no math genius, I never got past statistics, and the only math I’ve come across so far is adding up margins and padding in CSS and adding seconds for audio in ActionScript.

I may never be able to build anything as cool as chicagocrime.org. But I enjoy coding, in the same way that I enjoy writing. So scholarship or not, I’ll learn how to manipulate database information, build time lines and maps in Flash, and anything else that looks like a great way to spread information online.

Regional gas prices

AAA has a gas price estimator that estimates how much your trip will cost in gas based on average regional gas prices, miles per gallon and the make and model of your car.

Sadly, the interface is horribly ugly - even the Web page is built in tables - and the vehicle year doesn’t go any further back than 1998. Also, given the miles per gallon and average gas prices, why do they need the make and model of the car?

Still, another example of what can be done with a question, a computer, and a little programming.