Gabriel Nagmay: My name is Gabriel Nagmay. I’m with Portland Community College in the beautiful Portland, Oregon. I have to keep remembering to say Oregon because I'm on the other side of the country now and there are two of them. Now, I know this is the technical track and I got that great introduction but I just want to preface this with saying that this is semi-technical presentation. Yes, we are going to look the code, but really my purpose here is to define what an API is, tell you why I personally love them and then go through a bunch of examples showcasing what you can do with APIs. To that end, since we only have 45 minutes in here, I’m going to show a lot of examples. I’ve already taken these slides and all the code for all these examples and put them on my website which is gabriel.nagmay.com. It’s all up there. I’m a strong supporter of sharing, share and share alike. So, you can go and download those and get started. Not all of them are full examples but they should point you in the right direction. And if you have any questions, go free to hit me up via email or, if you’ve been on the back channel, I’m on Twitter all the time, so @nagmay and I should be able to respond pretty quickly. So here’s a little bit of an expanded overview of what we’re going to talk about today. Again, we’re going to define APIs and talk about what we’ve done with them at PCC, how we embrace them and why we made those decisions. Then, we’re going to jump right into showcasing examples that we’ve done. Not all of these are from PCC but most of them are. We’re going to look at Google Maps, of course, which is one of the more famous ones that people have probably used. We’re going to look at photos via Flickr, both managing and displaying them. Same thing with video via YouTube. And then we’re going to look at some interesting examples with data via Google Analytics. If you look at my slides online, I actually had a whole section on social media as well. But as I was going to the slides last night, I realized there's just way too much information. I can talk about any one of these subjects for 45 minutes. So something had to go, so I cut the Twitter section, but if you have any questions specifically about that, just let me know via email or via Twitter. |
|
2:14 |
And to that end, I’m going to go as fast as I can or leave some time at the end for questions but I’ll have to ask you to hold your questions until the end. So jumping right in, I wanted to find what an application programming interface or APIs because when you type in API to an Image Search, we’re just talking about this, you get all sorts of convoluted charts and graphs. Arrows going this way, boxes over here, multiple things going on and I wanted to explain it simpler. And at space, this is really what it is. You have on one side a big Web service: Google, Yahoo, Amazon; and you want to get to their juicy, juicy data. They got data features on their side that you want to access to but they’re not just going to hand over the keys. They’re not going to give you direct access to hit their databases, to look at their code. That wouldn’t be a safe thing to do. So what they do is they build this interface, this gateway, that they do give you access to. This gateway can have many different forms in practice. Some of the examples we’re going to look at is JavaScript. So you include one of their libraries and then the client side this asynchronous calls to just get functions that it needs to do things on the other side. Other ones use RESTful XML, so you formulate your query as URL and when you hit that page, it just place the XML results right there which you can then pull back in and do things with. The really cool thing is that for all of these big APIs that we’re going to show you today, there’s libraries built upon them. So you don’t have to start from scratch, you don’t have to always necessarily deal directly with the API. A lot of times there’s libraries that will really help you out. |
04:04 |
So, like I said I’m at Portland Community College and it’s been kind of a struggle there. I’m actually one of the newer members. I’ve only been there about five years and it’s been kind of a struggle to get people to embrace using outside Web services. To me, really, it’s all about getting more done while doing less. And that’s really important when you look at the numbers. So Portland Community College, it’s a pretty big place. We have three main campuses scattered throughout the city and throughout the local area. These are full size campuses with lots of students, tracks, bookstores, all that good stuff. We also have seven centers which are not quite campuses or probably missing a bookstore or a track but they're still large places where students go. Two of those were built in the past year. So we’re expanding rapidly. There are over hundred locations in the community where people take Community Ed classes and they are constantly changing every term. We have about 3,000 employees and by the end of this year, we’ll be serving a hundred thousand students a year. So it’s a really large school. We’re actually bigger than all of the universities in the state combined when it comes to students. We have to compare those numbers though. Those are very big number to this number. This is the Web team. We’re responsible for all Web services at the college. And actually for this talk today, this number is actually quite a bit lower because one of these people is my manager. One of them takes care of the portal 24 hours a day and there’s nothing else and one of them takes care of the servers in the backend database. So really it’s me and Karen, my Web developer, who take care of all the public sites, the internet and everything else. So this doing less and getting more than mantra has been really important to us to be able to offer services at the college to our users, but there are considerations. When I first got there about five years ago, there were in-house home grown apps for a variety of things for photo galleries, video, news aggregation. And in many ways there are still are home-grown apps there that we're maintaining on a daily basis. |
06:28 |
When we start looking at moving away from building new homegrown apps and working with Web services provided by other large companies, there were a lot of things to consider. When you have a homegrown app, you really have to start from scratch. That means setting up database, putting in the initial content, setting up the CRUD operations—create, retrieve, update, delete—and once you have all that, then you can look at the user interface. With an API, the database is handled by the Web service. The API is your CRUD operation. It’s the way you interact with the data. So when you’re using API you can usually just jump right in stop worrying about the user interface, how people are going to see this data, what they're going to be able to do with this data, rather than worrying about the storage and transmission of data. Talking about data, homegrown apps, usually the data does a single task. So, we’ve got a video that hosted just in our site, people are only going to see it when they come to our site. That said, videos on YouTube, sure they’ll see in our site but they’ll also see it when they go around YouTube and hopefully directs some more traffic back to our site. Same thing with a variety of media. You can also consider the bandwidth. We actually have great bandwidth at the college but it’s never going to compare to Yahoo!'s bandwidth. So when we’re serving up images, if we’re serving them directly from Yahoo! via Flickr, the end user's going to get the fastest possible results, which is great for everybody. On the flip side though, you may get Yahoo!’s bandwidth but you’ll also get Twitter's uptime. |
08:04 |
This means that you don’t only have to consider about your service going down but you have to consider this Web service going down and Twitter's a notorious case where it tends to go down with the worst possible times. Now, there are easy ways to mitigate this. One thing that we often do is that now we actually cache a copy of the data on our servers, and so the next time we hit a service like Twitter, if it’s not available, we can just serve up the cached copy. It’s not that difficult to do but it’s just an extra layer that you have to think about when you’re using an outside set of services. And finally, the big one for a lot of people at my institution, control. When you do a homegrown app in-house, you control the database, you control the content, you control the coding, you control the access, but you’re also completely responsible for all the bug fixes. You’re completely responsible for all the new requests and features that are added to it. So the trade-off and for us, I really kind of have to dive in and start using some, so I start putting up some maps, working with YouTube video a little bit more to show the advantages versus a lot of the concerns that were out there. So that, I think we’re going to jump right in and talk about maps. It’s a really good place to start. But how many have a Google Map on their site right now? OK, good. That was a good number of you. It’s a great one to start with because map is not something you would want to do in-house. Wait, I should ask. Is anybody doing maps in-house? OK. It’s a huge issue to create maps. I mean, acquiring the satellite imagery, let alone drive around the entire world trying to figure out the best directions, it’s not something that you really want to do in-house. And Google offers this, and Yahoo! another services too. I’m just going to use Google as an examples because that’s what we use. They offer this free and they offer you a lot of cool support for it. |
10:05 |
So for those of you who have it, put a map in, and again, this code right here, you probably can’t read. It’s on the website. Don’t sweat it. It’s just to have me be able to follow along and show you with the example. So here is a simple map for one of our galleries. It's in line in our webpage. You’re not seeing it as a webpage. And this is using Google Maps Version 3. It's their third version of the Javascript API and it’s got a lot of cool band just as if you’re using any of the other versions. One of the advantages is it doesn’t require a key. Previous versions, you had to go register with them and set up a key, which wasn’t hard and it was free. But this, you could just take this snippet from my site, put it on your site, and then it will work right away. Here, you can see that, it’s using JavaScript and it includes the JavaScript, the library, directly from Google and then we simply set up the map. This is using jQuery but it’s not necessary. The stuff inside look exactly the same. We set a latitude and longitude. We set some options: the zoom level, the map types. There are a couple of different map types that you can do; and then we create a map and drop in to an element on the page. So in this case, we’re dropping it into a divide called map canvass and we're even setting a marker. And this little snippet of a code, it’s great. It’s very simple and suddenly they’ve got a real map they can drop and drag things around. They can click on the marker if they want. They could go to Google Maps and get directions for it. One thing that I will know here is we often—when we do this for real—we’ll take an image and put it inside of the divide that we’re replacing. Because if somebody’s JavaScript turned off, of course, they can’t use Google Maps but they'll still be up to see the static image of the map. Just another step we do and try to make things as accessible as possible. So here is a more interesting example. This is a map from 50th.pcc.edu. A couple months ago, marketing came to me and said, “Our 50th anniversary is coming up next year and we need a site.” We want to, in preparation, start collecting stories from staff, students, anybody who’s ever been touched by Portland Community College. And I went, “OK, it’s really cool. We can set up a form and do that or we can set up an interactive map where people can actually put their markers directly on the map.” |
12:30 |
So if you go to 50th.pcc.edu—and you can do that whenever you want—you click on “Add Your Mark To The Map”. You go in there, and how it works is the JavaScript is exactly the same way for displaying the map but all the data is pulled dynamically from WordPress. This is just a WordPress installation where I put a custom post type called Map and when someone enters their story or records the story and records the metadata from the latitude and longitude. And this little snippet right here is just the query post from WordPress, which you should be familiar if you ever used WordPress. And it’s taking the latitude and longitude and metadata and it’s creating a ray that fed right into the JavaScript and boom, we have an interactive map. This was incredibly fast for me to set up. This map took me, I don’t know, ten minutes to set up the WordPress installation. With everything else, it probably took an hour. So we were rapidly prototyping this and getting feedback on it as it was being developed. Any problem? Audience 1: I'm sorry to interrupt. Gabriel Nagmay: Yeah? Audience 1: Can you mind switching the lights for a minute? We're hearing music and while we are hearing it... Gabriel Nagmay: Coming from my teeth? Audience 1: Maybe. I apologize. At least I’m here. I got somebody else to corroborate it. Audience 2: Yes. Audience 3: Thank you. I was too. I was like, they're going nuts. Gabriel Nagmay: Can we hear this? Is that on? Is that loud enough? Audience 4: Not from here. Can you hear Gabriel? Gabriel Nagmay: Can you hear me? Audience: Yeah. Gabriel Nagmay: All right. OK, cool. Well, we’ll have music. Is it good music? I can’t. OK. Audience 1: Don’t mind me. I’m going to see what I can do with that. Please continue. |
14:10 |
Gabriel Nagmay: I’m going to keep going. [Laughter] Gabriel Nagmay: So, the other interesting thing about this map is that the map itself isn’t the only thing that uses the API on the page, right? We’re asking people. This is the little form that you see when you click it. Ask them to put it in their address, and when they put in their address, it actually uses the JavaScript data API from Google, which is also freely available, and it creates a geocoder to actually take that text and convert in to a latitude-longitude. And we actually do some it’s just as simple as this, geocoder, new geocoder and then address and we do the function and we get the results for the Geometry location. So this little snippet of a code takes my home address and converts it into this latitude-longitude over here. Now, what’s really cool is that we actually wanted to get some feedback to let the person know that they’re in the right city because if I type in my address 6330 Northeast Emerson, it’s actually the first hit is in Texas. I know. I don’t know why they don’t like me but first hit it is in Texas. So, what we do is we reverse geocode, the latitude, longitude, and then in this green right here, we spit back out, once they’re done typing, the city, the state, and the country. So, wherever, we give them immediately the JavaScript feedback to say “Oh yeah, you’re in the right city. We got your address. We know where you are.” And the full code for this is a lot of if, else statements depending on what things happen. But the heart of it really is just this five lines code right here, and that’s it. It’s a really cool thing. We just launched a site a couple of weeks ago with 50 or 60 people, put in their information, put their mark on the map and there’s been no trouble with this piece. There’s been no learning curve. It’s just a regular Google Map. They hit it. They type in their address and it’s up and going. |
16:02 |
Another thing we do with maps that's quite interesting is for maintenance, right? So these are our parking locations. So this is everywhere on PCC that they patrol for parking. It makes people unpark in the neighborhoods and taking locals off. And we use to maintain this via separate Google Maps because we’ve got ten locations that we do this for. Now, what we do is we take a single cam out which is a Google Maps document and we actually let Parking go ahead and edit that because it’s a pretty easy thing to do in Google Earth. Sorry, if I said Google Maps. In Google Earth, they go ahead and they draw the shape and we take that and it’s simply, we create a camera layer and it pulls that one file and displays the locations in all ten of those maps. So, it’s a really nice way to maintain data, not just display it, and it’s been a great thing for us. OK, photos. We use Flickr pretty exclusively for photos now because there’s a great API that it’s out there, if you go to their documentation as a whole app garden that you can explore and look through, which is kind of cool. The two important things I’d like to know about Flickr is, one, you do required key. So you have to register with them and get a key. That lets them make sure that the requests are coming from your side and that you’re not doing a billion function calls a day to their service. If you are doing a billion function calls probably at that some type of agreement with them. The other thing to note is that they do use RESTful XML. So, the way it works is you sent, you hit a URL with your query and it displays the XML and pulls it back. And sometimes you can be kind of ugly in talking to someone who doesn’t work in that way, but that’s all right. There are these extra libraries that are written on top of that, that make things really, really simple. So why would you want to use Flickr? First, there are tons of in-house apps that you can host for doing photo gallery. Well, Flickr is great at organizing photos, at organizing groups—which means people who don’t even have the same accounts—at managing and maintaining photos. And because of this, I found a lot of my users were already using Flickr. They were already there. This is what they did. If I had to transition them to an in-house app, there will be a learning curve, and there was no reason to do this because I can take their photos directly out of their sets, display them on the website and the end-user is happy, they’re happy and it really simplifies things. |
18:32 |
Here’s a gallery that we did for this public event we call Art Beat. And the cool thing about this is this is not a set from one user. This is actually a group. People from the public are able to submit photos to this. And the way that Flickr works is that we have one of the members of the committee for Art Beat moderating this. So we make sure that we don’t get anything that we don’t want to see up there. As soon as they moderate something, it appears on Flickr so people can find it there and it appears in this gallery. We actually say "This is from an Art Beat group pool on Flickr", but if we don’t put that, users would never know where these photos came from. When you click on one of this, it actually opens up on a nice slide box effects. It doesn’t even take them to Flickr. It’s up to you how much you want to tell your users what you’re doing on the backend because most of the times they don’t care. They’re just being a cool gallery. This uses a jQuery library called, I think, jQuery Flickr, which makes the whole thing really easy. You put in your API key. You put on the group ID. You can also set a callback. In this case, it’s a lightbox callback which gives that cool effect that we’re using. And it’s completely hands-off as soon as I set this up. The committee takes care of the photos in Flickr, gets displayed here and I don’t have to worry about maintaining any software. |
20:01 |
This is a little bit more of a complicated example. It’s actually not an educational example, so I hope you’ll excuse me for a second. This is a site I built for some friends of mine who make this custom cargo bikes. In this case, it’s a beer bike which holds two full kegs around Portland. They had an awful website that was all done in Flash. But worse than that in my mind is that they were using Flickr really heavily. But when they wanted photo on their Flash site, they had to upload it to Flickr and then they had to go and upload to their Flash site. So, there just weren't. There were no photos on their Flash site. So what we did as I set them up with the WordPress installation and I created this widget in the admin console where they can simply type in the set ID. They go to Flickr, they create a set, they type in the set ID and when the page is rendered, a PHP function goes through and creates this dynamic interactive gallery. And it’s as simple as that from their perspective. That’s all they have to do. If they go and they change one of the photos on Flickr, it automatically changes on this side. So again, it makes maintenance of this kind of Web pages incredibly simple. All right, we’re rushing ahead. We’re going to talk about video which is one of my favorite things to talk about because we’ve done a lot with video. Actually, I gave a presentation two years ago here about accessible video. Since then, we’ve actually move to YouTube. We have an educational partnership with YouTube, which if you don’t have one, definitely, I’d look into it. No advertising, no time limit as long as you guys have educational material up there. The one problem that I see with… Well, I guess I’m skipping ahead a little bit. I should say there are two different YouTube offers to different APIs: one, the player, for controlling the player; and one for managing the content – so, uploading, editing, that kind of stuff. And I wanted to show you first the player API really quickly. This is a little site that I put together last year called YouTube CC. Surprisingly, YouTube doesn’t bother me about the name yet probably because it does a good thing. It’s for captioning video. This took me about a night to write. It’s all in JavaScript using the JavaScript player API. It allows you to put in the address of any YouTube video that’s out there and it brings up as a nice little setup here where you can play, pause a video and add captions. If you click one of the captions you’ve already done, the video goes back to that section and lets you re-caption it. |
22:37 |
So, this whole thing is an application where people can cap a videos from any YouTube, then download them and do whatever they want with them. And again, it took me just about a night to do which was good because we don’t use this thing anymore. YouTube actually has this cool auto-timing feature inside of it which I recommend you look in to, which kind of made this whole thing a moot point. But it didn't matter to me. I didn’t take a week or a month to build this. I prototyped it up in an afternoon, built it that night, pushed it out, used it for a couple of months, and then when something better came along, we went with that. It is still up for archiving. It’s still get surprisingly about a dozen or so video captions in a day, so I’m not planning to take it down. It is a bit buggy. I haven't really been maintaining it. So if you're finding errors in it, let me know. The other API is data API and this is the cool one. We’ve got an education partnership. Good advantage to that, lot of cool things you can do. The problem in my mind is that they only give you one login and one password, right? And I don’t want to share that with every single faculty at my institution. I’m not even comfortable sharing it with all the instructional support people because if one of them went wrong, knock on wood, but if they did, they could change the password and lock everybody out. So, we turned to the API to take care of this, through the upload version of the API. What we decided to do was we have our own credential system on our servers where they can access different services, and we put an upload form behind that. It’s a little bit complication, so I’m just going to show you. |
24:14 |
This is a graph directly from YouTube’s API and I’m going to show you how this actually works when a user does it. So, the user’s browser come to our application and we send them a form. This form asked for a title, description, some of the textual stuffs that YouTube requires that's sent back us. We then on our side, take it and send that off to YouTube and request a unique URL and a key, one time key, to upload the video. Because they don’t want people – they want to be very strict with security when it comes to uploading videos. They don’t want lots of spam video because it's automatically being uploaded. They send us back the URL key and we can then create a second form which users can browse, select the video and hit upload. When they do that, this is the important thing, the video goes straight to YouTube. It doesn’t go to our service at all. It doesn’t take any of our bandwidth. It doesn’t take any of our memory. It goes straight to YouTube, then YouTube redirects them to our application and we can do whatever we want. We give them a confirmation. So, from the end-user, here’s what it looks like. They start out by logging in with their credentials, their MyPCC credentials which is something that we use for portal and places all over the website. They then get a list of the things that they have access to. This is my list so it's little bit longer. A lot of them will only see video upload. That's the important one for this purpose. When they click on it, they get this form here, which is at first set which lets them enter data. Now, this is a good place to reinforce what can and cannot be uploaded to an educational site. I highly stress doing that. Even if you do this, even if they have to look at this every single time, they’ll still find a way to upload stuff they shouldn’t. Two weeks ago, they were uploading Star Wars clips. I’m not kidding and I didn’t understand the educational purpose but if anybody going to come after us, George Lucas would be it. So, the good thing though is that we actually warn them in here that what we do, to take care of that, is we tag every video in the normal YouTube tag with part of their username. So if something is uploaded that’s questionable, we can figure out who it is and it still happens. It’s pretty amazing. |
26:23 |
So they fill out this form, and then all this magic happens in the background and they’re immediately taken to the upload form. They don’t see any of that junk in the background. That’s all handled between my server and the API. They can then select the video. Two gigabytes was the old, I think it’s now 20 gigabytes that they can upload. And since it’s not hitting our servers, it’s going straight to YouTube, we don’t care what the size is. The bigger, the better. We pull HD videos being put up there. We have one on HD video that was an hour long. I did not want that hitting our servers. Go straight there. It takes a few minutes depending on the size of the video. And then this is what they get, they get a confirmation on our site saying “Here you go. Here’s your video.” This is great. I mean it completely bypasses all of the concerns that we have about video on our server but still gets us the control to let certain people in and keep other people out. It’s a great balance for what we do. This is what the video looks like when it’s on YouTube and you can see this along with their normal tags this JJohnsto. That’s part of the username that we put in there. So if we need to, we can go back and look. It’s a simple way. There's other way to do it but the simple way that we’re able to keep track of who’s uploading the Star Wars clips, and it wasn’t Jim]. So, he at least I could use his name. All right, so my final set of examples, which is good, because I think we’re short on time. We’ve got about 15 minutes and I’m hoping there are some questions - is Analytics. And Analytics is kind of cool because it’s not used much as these other three. And the other three are used a lot but Analytics is often ignored. If you got the Google track and code on your site and are using Google Analytics anyway, you’re already accumulating all of these data. So you might as well do something cool with it. |
28:08 |
Of course, you can display it. This is actually not something I wrote. This is a WordPress plugin, really simple, uses the API, grabs numerous stats, displays it in a really simple way right on your WordPress admin site or in the external site if you want to show to the user. Simple. A little more complicated—well, I shouldn’t even say complicated because it’s really not—but you can grab individual queries and do things with them. On this case on our new site, we want to show the most viewed article but we don’t want to keep track of that. There’s no reason to keep track of that in WordPress or in our servers since we're already keeping track of it in Analytics. So here, this is in PHP. I’m requiring the GAPI PHP class which I downloaded directly from Google. They host this. Well, we host it but they’re the ones who gave it to us, I should say. We set up a GAPI using our credentials, normal credentials that we would log in to Analytics with, and then we simply do a report data request. And then in this case, we want to get the page titles of the top XML pages and then we can just sort those into a list, and spit them out. And this is a good place where we do caching on our site just in case our request fails. Those top ten titles change every time somebody hits the site. So we cache it, and then if we can't reach the service, we use the cached copy of it but we never even notice that being a problem. Here’s my favorite example. This is our Search. It’s a little bit heavy on the search on this site. But the cool thing on this example that I want to show, is on the right hand side, we show the top 25 searches in a little cloud and we used to do this by hand. We used to get the Google Analytics and take the top 25 and write it out and put them over there and that was fine. People find really useful. We did this every month. The interesting part of this for us and this is why I love APIs is, now that it’s being done it automatically, I can really think about what’s going on, what to display. |
30:23 |
So, when you’re doing top 25 searches, "Shall I display the top 25 today? This week?" That might not reflect to people looking for it because the searches are constantly changing depending on what part of the term you’re in. "Do I do all time searches?" Well, I mean, there can be things in there that I care about five years ago that they don’t care about today. It’s very likely. So, what we decided on after doing some testing and going around and doing some user testing on different people, which is great, because this thing we just prototyped really quick, had it out there running. We have a couple of different versions. Was we decided to take the result, the top 25 results, from a year ago plus or minus a week. So, that gives us a range at this point in the term, at this term in the year. So, on the first day of classes, they’re likely to get search results in the cloud that are related to the first day of classes and so on and so forth. And again, when I set it up I forget. I haven't had to type in a year and a half. It’s been great. All right, so, looking forward—I actually have to find my set of notes because I want to read something off to you—I just want to talk about a couple points about what I feel the future APIs are. First of all I think there is going to be more of them. It’s something that the big companies are releasing, that are very handy, that people are doing some really cool things with, matching up cool applications, doing stuff with the cool data. And so I showed you just a couple of them. Included with these, I have personally use Amazon, Basecamp, BizRate, Delicious, Dopplr, Etsy, Facebook, Foursquare, FriendFeed, GitHub, DotGov, IMDb, Last.fm, LinkedIn, MediaWiki, Microsoft, NetFlix, Newegg, NPR—just kind of a cool one—New York Times, OpenID, Tumblr, Twitter—which I do have examples of that on my site—Vimeo Weather, White Pages, and Zillow. These are all available right now to get a lot or at least some of the functionality out of those sites and really make your life a lot easier |
32:27 |
Also, I see these things getting safer for the end-user. This is OAuth. This is something that Twitter went to very recently that actually made work with it a little bit harder but it made it much safer for the end-user. It used to be that when you have a Twitter app, you had to ask the user for their username and password and you would be the one storing them which, “You can trust me. Sure, but..” I don’t know about all those people who are asking for username and password. With OAuth, but I’m not going to go through the exact way to do it, they get passed to Twitter and authorized there and your application is then authorized to do things with their account. It’s a lot safer for the end-user, little more complicated on the API side but really it makes people trust this kind of outside API-based applications a lot more, makes them a lot safer. The other thing that I look forward to and I recommend that you go and play with is this one stop shops for API. So I was introduced just a couple of months ago. It's been up there for awhile, YQL. YQL is Yahoo!’s API thing that they’d been doing. It basically takes all the different APIs. Most of the ones I just named off that I played around with puts them into one spot, where not only do you have access to all of these different APIs in one stop but you can actually use them via sequel light query. So here, select all from maps, .map where ZIP equals this and it will return, and there’s your actual formatted view and it gives you the REST query and all the stuff and you can mix and match this together with really cool things. Give me the weather at this location and driving directions. Give me, depends what you’re looking for. You can just mash them together really quick and make this really nice queries and the end result, you’re using the Yahoo! API to reach out and hit Google or IMDb or FriendFeed or New York Times, whatever you want. It’s just really one stop shopping for API. |
34:34 |
There’s a lot of cool stuff going on. I haven’t use it extensively but I hopefully you’ll go to the developer at Yahoo, play around with thing. This is online so you can do live stuff. All right, so, I’d like to take a couple of minutes for questions, see what people have to say. Again, all my source files and code are on gabriel.nagmay.com. If you have any questions, because they're not all complete. I put up useful snippets. I hope they’re useful. But if you have any questions at all, you can contact me. I’m always on Twitter and I’m happy to share anything that we’ve done except for my username and password. Any of the code that we’ve done, I’m very happy to share. Questions? Would you like to come up and use the mike? Come on down. Audience 5: With Flickr, can you talk a little bit about how you got it set up on your campus with regard to departments or what kind of separate accounts? Are they using the free account having a limit of 200 photos and that kind of thing? That’s an issue in our case. Gabriel Nagmay: Okay. Thank you for coming all the way down. We started out small with it. We had an original paid account, so it was unlimited for the Web team that we were using and we started there, and we started managing photos. Now, that we’re using API, we’re letting people set up their own accounts, and a lot of cases they’re setting up groups. So it’s not just their uploads but it’s other people’s uploads. |
36:14 |
Because we’re the ones to build the Web pages, we know where it’s pointing to. They can’t just point it to a new gallery or new post or a new set. So we look at that when we set it up, but the onus is really on them for what photos are in there and if they want to pay for the Flickr account or not and it really hasn’t been much of an issue. Our foundation, I think, is paid for one because they use it extensively like every event, they take pictures themselves. They put up a lot of photos. Everybody else has been using free accounts. It’s been working up pretty good. Other questions? Really? Good, come on down. Audience 6: For your Google Maps example, what type of moderation you guys use for people that are contributing to that map? Gabriel Nagmay: Awesome. Thank you. That’s a really good question, Matt. We just set this up. This is one of our first experiments with moderation of this type really, and when we originally set it up, people are like “Okay, everything needs to be moderated.” I actually have a little bit of code that says, “We look at every post and spam or gibberish or hate mail, we can remove anything.” Just a little bit of code that says “You’re cool so you probably won’t do this but if you do, we’re not going to post that thing." The problem was is that they couldn’t immediately see what they posted. So they put a story in there and just brought them into a blank kind of page and said, “Thanks,” and people weren't sharing this online and in social networks, so we got this great little share buttons. We want them to share so more people know. So I convinced my team and marketing, talked to them a little bit because they had a big deal on this to open it up. And it’s completely open. As soon as somebody post something, it immediately appears on the map. |
38:10 |
Now, I get notification of that. So just like YouTube where I’m following along doing some after the fact moderation, we’re doing the same kind of thing there, and it works really well. We actually haven’t had any problems yet with it. Nobody’s putting bogus stories. But even if they did, it would be an hour or possibly been up to a day and we will take it down. So I really like the post-first-moderate-later kind of policy for these things. It makes the Web more alive with this kind of case. Is there another one back there? All the way in the back seat. If you’re sitting at the back, you got to come all the way down. Audience 7: Have you run into a situation where an API has changed or the result set given back to you from the API has broken some of the code that you previously written. Gabriel Nagmay: Yes, and that is really good question because it happened to us twice with two different APIs and this is one of the things you do have to watch out for. This is where you lose control a little bit and you do have to do some maintenance. The first one was with YouTube. They changed theirs ever so slightly. We jumped on YouTube.API when it first came out. And so it was, they didn’t label it beta but it was very much beta, and they changed it and we had to react. But luckily since we were doing it through our servers, we were doing some checks and balances, that when it broke, it said “Unable to do this request. Please contact your administrator” and they gave them my name. So we found out about that really quick. It was a simple change. The other one was a little bit harder which I didn’t talk about – Twitter. But when they went to OAuth, I had written all this plug-ins for WordPress, I downloaded this cool stuff with it and it all broke. And it was not a simple matter to go in and update, and I've updated some of them but not all of them just because I have to go and touch them all. |
40:06 |
But in that case, Twitter did the right thing. They gave people months ahead notice. They let you know that this was going to happen and if I’ve been diligent about it, if I had really cared about those, and they’re being used very heavily I would have gone in and updated them beforehand. So it is something you have to watch out for, definitely putting those checks and balances when you’re doing on your servers, you know when something goes down. But in all the APIs we’ve been using it has happened twice and in both case, we’ve found about it almost immediately. Any others? Audience: I don’t know about anyone else on the room, I’m more of a designer than a programmer. How well are these APIs documented and how did you use them? Google’s APIs, they’ve got an entire forum in the Google Code base that just really makes it accessible. Flickr's, not so much but there are some basic examples that are out there. If you’ve got a grasp of JavaScript, even the basic, you should be able to dive in and do some of these really cool things. I think that’s about it. All right, thank you. [Applause] |