Getting vCard info into a QR code using the Google Chart API

How to get vCard info into a QR code using the Google Chart API? This question has been coming up occasionally and it can be a little quirky. I thought I might document my process of making this work with the Google Chart API.

1. Create the unencoded vCard info. Sample Below:

BEGIN:VCARD VERSION:3.0
N:Clark;Jason
FN:Jason Clark
ORG:MSU Library
TITLE:Team Leader/Digital Initiatives Librarian [Associate Professor]
TEL;TYPE=WORK,VOICE:(406) 994-6801
EMAIL;TYPE=PREF,INTERNET:jaclark@montana.edu
URL:http://www.jasonclark.info
REV:20111013T195243Z
END:VCARD

2. Run the unencoded vCard info through a utility or programming function. In this example, we are using the online “URI Encoder / Decoder” tool http://andrewu.co.uk/tools/uriencoder/. Some common functions in programming languages that would do the same thing are: Server.URLEncode() in ASP, urlencode() in PHP, and encodeURI() in Javascript. After pushing the unencoded vCard string through the “URI Encoder / Decoder” tool, we get a resulting string like this:

BEGIN%3AVCARD%0D%0A%09%09
VERSION%3A3.0%0D%0A%09%09N%3AClark%3BJason%0D%0A%09%09
FN%3AJason+Clark%0D%0A%09%09ORG%3AMSU+Library%0D%0A%09%09
TITurLE%3ATeam+Leader%2FDigital+Initiatives+Librarian+%5BAssociate+Professor%5D%0D%0A%09%09
TEL%3BTYPE%3DWORK%2CVOICE%3A%28406%29+994-6801%0D%0A%09%09EMAIL%3BTYPE%3DPREF%2CINTERNET%3Ajaclark%40montana.edu%0D%0A%09%09
URL%3Ahttp%3A%2F%2Fwww.jasonclark.info%0D%0A%09%09
REV%3A20111013T195243Z%0D%0A%09%09
END%3AVCARD

A potential gotcha here is the URL value in the vCard. Make sure the URL value in the vCard is encoded and has changed from

URL:http://www.jasonclark.info

to something that looks like:

URL%3Ahttp%3A%2F%2Fwww.jasonclark.info%0D%0A%09%09

3. Next, we place the encoded string in the Google Chart API to generate the QR code. Put your encoded vCard string in the URL below after the “&chl=”. For more info, see the online wizard tool and documentation for the Google Chart API. Check the link below to see the generated QR code.

http://chart.apis.google.com/chart?chs=200x200&cht=qr&chld=|0&chl=BEGIN%3AVCARD%0D%0A%09%09VERSION%3A3.0%0D%0A%09%09N%3AClark%3BJason%0D%0A%09%09FN%3AJason+Clark%0D%0A%09%09ORG%3AMSU+Library%0D%0A%09%09TITLE%3ATeam+Leader%2FDigital+Initiatives+Librarian+%5BAssociate+Professor%5D%0D%0A%09%09TEL%3BTYPE%3DWORK%2CVOICE%3A%28406%29+994-6801%0D%0A%09%09EMAIL%3BTYPE%3DPREF%2CINTERNET%3Ajaclark%40montana.edu%0D%0A%09%09URL%3Ahttp%3A%2F%2Fwww.jasonclark.info%0D%0A%09%09REV%3A20111013T195243Z%0D%0A%09%09END%3AVCARD

4. If everything works, the Google Chart API returns a link to a QR code image with the vCard info encoded. Place this URL in an HTML <img> tag and you’ll have a QR code on your site that will have vCard data. Note: You will need to add your specific contact vCard data in Step 1.


Mapping your location with Google Static Maps API (tutorial)

The Google Static Maps API  (code.google.com/apis/maps/documentation/staticmaps/) allows for a dead simple way to embed maps showing a specific location for mobile and desktop environments. The real advantage of the Google Static Maps API is that the embed comes in the form of an HTML image <img> tag. In this quick codelab tutorial, I’m going to show you how to create a static map and set a location using the Google Static Maps API. If you have a familiarity with HTML, the markup for the image should be familiar.

<img src=”http://maps.google.com/maps/api/staticmap?center=Bozeman,MT&zoom=13&size=310×310&markers=color:blue|45.666671,-111.04859&mobile=true&sensor=false” />

As I mentioned earlier, it is a simple <img> tag with a call linking into the Google Static Maps API. In order to assign a specific location we need to pass a few parameters to the Google Static Maps API. Included among the customizations:

  1. A central location for the map
  2. A zoom level for the map
  3. A size for our map image
  4. A marker color and position using latitude and longitude
  5. Set the map to display for mobile settings without a sensor

The necessary pieces to enter are a central location and your specific latitude and longitude. Enter your hometown for the central location in the format of {city, state or principality}. To get your latitude and longitude, visit gmaps-samples-v3.googlecode.com/svn/trunk/geocoder/getlatlng.html and type in your library address. Copy the latitude and longitude values that are returned. Enter these position values as a comma separated string {latitude,longitude}.

Here’s the image src= markup with cues for where to add your values.

http://maps.google.com/maps/api/staticmap?center={YOURHOMETOWN}&zoom=13&size=310×310&markers=color:blue|{YOUR LATITUDE/LONGITUDE}&mobile=true&sensor=false

Once you have the link filled out add it to your image <img> tag on a live HTML page and you will have a local map to your library or any other specific location.

msu library bozeman mt


Librarian Day in the Life, Day 5 (Round 4)

The fifth day in the life of the Head of Digital Access and Web Services at Montana State University Libraries. Based on tweets in chronological order.

  • 8:35am. AM check of email & twitter. My annual review is today at 2:30pm. Should be a good conversation with the deans. #libday4
  • 9:15am. Filling out monthly summary leave reports. Have a block of time before annual review. Need to stay in office & close door. #libday4
  • 10:58am. Email faculty re: feedback on tenure document revisions due noon on Mon. Reading draft of 3-5 year strategic plan for lib. #libday4
  • 11:09am. Quick visit w/team member re: moving architectural drawings app into production. Performing code audit and moving it up. #libday4
  • 1pm. Heading to lunch. Answered a quick Infotoday #cil2010 email re: javascript workshop. http://bit.ly/bLQEf5 #libday4
  • 2:17pm. Excited by opps for DAWS team in strategic plan. Digitization, archiving, web services… Heading to annual review. #libday4
  • 3:30pm. Good review. Now meeting w/range science faculty re: U of Idaho participation in MSU range science DB. http://bit.ly/9nneBb #libday4
  • 4:50pm. Joy 2 meet faculty that geeks out over pictures of grass you digitized. Collab w/U of Idaho looks promising. Weekend. End #libday4.

Ahh, the fifth and final installment… LibraryWeekintheLife… It was a Friday which is usually an open day for me. Time to think about week, start on some projects, prepare for next week. It also a day where some admin duties get finished. The morning was mostly about taking advantage of some free time to talk to team members, audit some code before making it live, and preparing for my annual review. The review was a good conversation about where my work is heading and how the team can help the library in the next year. Nice surprise at the end of the day as a range science professor was giddy to see some of the Hormay collection digital objects. It always helps to see someone genuinely excited about your work. There are times when you wonder who’s going to find this stuff valuable. More people do than you know… It also looks like there may be some funding for the range science project. Great to see as we did the initial metadata, DB and app design, and conversion pro bono. The theory was: if we show them something of value, we would be able to look for funding with next iteration. Worked out this time.


Librarian Day in the Life, Day 4 (Round 4)

The fourth day in the life of the Head of Digital Access and Web Services at Montana State University Libraries. Based on tweets in chronological order.
  • 8:35am. AM check of “the twitter” & email. Corresponding with film grad student over plans to do promo for Digital team. Start #libday4.
  • 9:45am. Thinking re: how to present Herbarium project to Bio Faculty. Working w/team on collaborative indexing/keyword project. #libday4
  • 12:35pm. Big win @ meeting w/faculty re: Herbarium. All metadata & scanning will be done by motivated faculty member. Lunchtime. #libday4
  • 3pm. Drop ins & drop bys. Conversation w/team & colleagues re: new digital media service. How to launch, get buy-in, make it easy. #libday4
  • 3:10pm. Filling out student time cards and reporting team leave for admin. Living the dream. #libday4
  • 3:21pm. Hour or so in front of me. Time to work on topic recommending search engine (proof of concept). Work includes data entry. #libday4
  • 4:17pm. Making Libguides API play nice with our database lists. I hate you unencoded &, but you are now fixed with urlencode(). #libday4
  • 4:33pm. @springshare @LibGuidesFAQ Whom do I talk to about structured data coming out of your API? <LI> in caps is not valid HTML. #libday4
  • 4:40pm. Broke search app. Checking error logs. Good place to stop for now. PM email check and then home to fam. Fix later. #libday4
  • 4:46pm. tail -50 error_log command gives: “syntax error, unexpected ‘ on line 253 of view.php” Note for later. #libday4
  • 8:57pm. Back in the saddle. Email colleague in Arts & Architecture re: people we met yesterday interested in go2collegeMT.org. #libday4
  • 9:05pm. Tracking down parse error in “search for databases by topic” app. #libday4
  • 10:05pm. Reducing noise to signal ratio in Google reader. Best signals get bookmarked at delicious/diginit/ #libday4
  • 10:35pm. Final PM email check. Thread re: Bio faculty’s flickr photostream @ http://bit.ly/aQeMVB ; metadata for plant repositories. #libday4
  • 10:55pm. Falling asleep at the wheel. Will have to fix search tomorrow. End #libday4.

Pretty average day.  Had some nice chunks of time, but I chose to do the face to face thing a little more.  It can take more time, but the “Drop Bys” can be an effective means of getting a person’s true feelings on a subject. No mediation by email or other tech, just one on one conversation. You can see some of my admin duties above as it’s the end of the month. Necessary stuff, but not my favorite. Big news for the day was the meeting with a Plant Sciences faculty about digitization of Montana herbarium samples. He’s already using flickr and has access to a high res camera. To top it off, he’s motivated to do metadata. Huge. Subject specialist with integral knowledge of objects doing first batch of metadata. We have plans to go after grant, but will build prototype using flickr API. Tasks for the day included: programming, data entry, networking, negotiating org politics, debugging, “metadataing”, admin documentation, prototyping, and sleeping. More tomorrow as I have my annual review with my deans… Bring it.


Librarian Day in the Life, Day 3 (round 4)

The third day in the life of the Head of Digital Access and Web Services at Montana State University Libraries. Based on tweets in chronological order.
  • 7:30am. Has decided that Earl Grey Tea doesn’t cut it. Going for coffee. Start #libday4.
  • 8:25am. AM email check. Thread re: ALA talk on cloud computing. Building search index for article DBs w/keywords fm Yahoo BOSS API. #libday4
  • 9:42am. Figuring out how MySQL automagically does relevance ranking. http://bit.ly/16tf6R #libday4
  • 9:52am. Checking MySQL error logs. #libday4
  • 10am. MSU herbarium digital project discussion. #libday4
  • 11am. Preso to school counselors re: go2collegeMT.org. #libday4
  • 12:41pm Back fm lunch. 11am pres to MT school counselors on new tech in education went well. Open afternoon. Time for programming. #libday4
  • 2:15pm Still working on optimizing search index for articles. Making progress with mysteries of MySQL relevancy ranking. #libday4
  • 4:15pm. Search interface is on dev. Team testing queries. PM email check. This portion of day over. Time for Fam time. More later. #libday4
  • 9:15pm. Back again. Trying to make openURL queries to Serial Solutions API work from one of our citation DBs http://bit.ly/9nneBb . #libday4
  • 10:15pm. Trolling through my feeds via Google Reader. Saving/tagging interesting stuff to Delicious. #libday4
  • 11:30pm. Google Waved reminder re: starting to record DOI in citation database records. It makes openURL much easier. End #libday4 day 3.

Quite a bit on the technical side today. Largely due to my having a 4 hour block in the afternoon. But, here’s the thing: if I want to build/work to customize library apps, I need these blocks of time. Picking away at these projects for a half hour here or there doesn’t work. Just before lunch, I had the opportunity to speak (with Terry Beaubois) to a group of school liaisions for the k-12 set. It was a Q & A session about new technologies that could be used in the classroom. uStream, iTunes for k-12, mobile devices were pieces of the discussion. It hardly gets any play above, but the MSU Herbarium project could be a winner. Rene Tanner has been working with the Bio department and pointing to our digitization services. Rene and I have an eye on some grant possibilities for the project and some early prototyping using Flickr as a data store.  Great day overall. Some of the meetings tomorrow have been canceled. I should have some big chunks of time tomorrow as well. Looking forward to it.


Librarian Day in the Life, Day 2 (round 4)

The second day in the life of the Head of Digital Access and Web Services at Montana State University Libraries. Based on tweets in chronological order.

9am team meeting. 10am MSU Extension Pub digitization meeting. Doing AM check on email. #libday4

11am Mtng w/instruction librarian to talk design & dev of mediaHub: http://bit.ly/cT8XQK . 11:30am weekly mtng w/Associate Dean. #libday4

12:37pm. Back fm lunch. Building interface for mentor/liaison app. Prepping for later mtng with colleague re: Openurl pres in Feb. #libday4

1:40pm. Google Waved initial questions for RangeLands West digital project. Looked at sample data for gotchas with data import. #libday4

2:35pm. Back from openURL presentation prep. Checking code demos: http://bit.ly/UKYEF . Need demos for general API mashup topic. #libday4

2:41pm. Coffee break with team member. #libday4

3:45pm. Back fm Library Faculty Advisory committee. Elected new chair & set up mtngs to facilitate discussion btwn Deans & Faculty #libday4

4:04pm. PM email check. Checked Google docs for shared presentation. Making sure files on dev server for work later after FAM time. #lib4day

4:35pm Going home to the fam. Colleague stopped by to ask about best format for data import. Loaded ? .csv in spreadsheet? #libday4

9:02pm. Baby sleeps. Working on Google maps mashup for ed grant. Maps colleges + events in MT. http://bit.ly/b0ENcr #libday4

10:15pm. Final email check. Finished with grant work. Time to relax. End #libday4.

This was a day with most of my meetings for the week. I’ve been trying to work my schedule this way as it frees up those precious blocks of time later in the week. Blocks of time where I can actually get some programming projects started. I’m still trying to find the work/life balance and you can see my working from home after Piper is in bed. This is very routine. If anything, I was surprised at how much I was able to work between meetings. That doesn’t always happen.


Librarian Day in the Life, Day 1 (round 4)

I decided this morning to participate in the “Librarian Day in the Life” project organized by Bobbi Newman. I like the idea of making my job more visible. I’m also hoping to learn about my typical week by capturing it in writing. I’ll primarily be tweeting the events at the hashtag #libday4 from my twitter account at twitter.com/jaclark. At the end of each day, I’ll present a digest of my tweets as a blog post with commentary if necessary. Here’s day 1:

Alright, I’m calling it. #libday4 day 1 is over. Tomorrow is my meeting day. Like to get that over early in the week.
less than 20 seconds ago from web
After baby hiatus… Drafting revision to tenure documentation. Auditing digitization opps with Range Science and MSU Herbarium. #libday4
13 minutes ago from web
Working on annual strategic initiatives for team. Prepping for team meeting tomorrow where we discuss possible initiatives. #libday4
about 7 hours ago from web
Rewriting some PHP and HTML code for web form/DB integration. Importing sample data into said DB. #libday4
about 8 hours ago from web
Writing about possible learning outcomes for ACRL webinar; Finalizing plans for #cil2010; Answering work emails. #libday4
about 10 hours ago from web
Working on geolocation javascript for project. Debugging w/help of Tweeps & FB. Release code sample and explain in blog post later. #libday4
about 11 hours ago from web
Help me test javascript geolocation function @ http://bit.ly/5U8mva . 1. Working accurately? 2. What browser? #libday4
about 12 hours ago from web
Mmm coffee… checking twitter, Google Reader for development, digitization, library stuff. My morning routine as human aggregator. #libday4
about 12 hours ago from web
@BillDrew4 My apologies for bumping you from #libday4 editing. I hit the wrong button.
about 13 hours ago from web
Down with the #libday4 mix.
about 13 hours ago from web

This day is a unique in that Monday is my “work off-site” day. As faculty, we have some freedom in how/when we get things done. As long as we are producing results, we have some latitude. It’s nice to work in a place that inherently trusts you. Monday is typically a research day, but this one turned into a social networking, coding, and documentation kind of day. Tuesday is my “day of meetings” as I like to get the face to face done early in the week and set up my projects. Expect some reporting on comings and goings tomorrow.


Blip.tv API and YouTube API Code Samples – Library Mashups

My chapter “Blip.tv and Digital Video Collections in the Library” for the recently released Library Mashups edited by Nicole Engard was in need of some code samples. I wanted to show how to use the APIs I kept mentioning in the writing which focused on the digital library mashup of TERRApod. So… here they are in their basic, rudimentary glory.

The complete code is available for download from my code archive. Think of these examples as the raw materials for building mashups with the blip.tv API and YouTube API. The blip.tv example relies on PHP 5, but I made the YouTube PHP4 compatible and you could adapt the code from there for the blip.tv API. I also included some CURL code in the comments of the files just in case your host requires it. If you have questions or improvements, drop a comment.

A quick word about the book: If you are at all interested in mashups and web services, take a closer look. The book covers one profession’s (the librarian) application of web services to library data problems. Contributions from industry leader’s like John Blyberg, Ross Singer and Karen Coombs make this an interesting read for anyone interested in how web services and open data are changing the nature of web development for libraries.

<end bookplug />


A Wordle View of Computers in Libraries 2009

So, I’m back at home while the Computers in Libraries 2009 conference is wrapping up. On the flight home, I got to thinking about major themes and it struck me that there might be a way to represent the themes visually. Enter wordle. If you aren’t familiar with wordle, you can paste source text or even pass URLs of feeds to a simple web form and get a “wordcloud” of major terms. I thought I might try pasting the Computers in Libraries 2009 program text into wordle. Here’s the wordle representation of cil2009. (I removed some basic noise words like keynote, track A, 11:30, etc.)

 (click on thumbnail for full image)

Not surprising to see “Library”, “Libraries”, “Search” and “Social” as some top terms. But, I am glad to see the terms around the edges making some headway. Terms like “mobile”, “development”, and “innovative” suggest that the profession is moving forward.  One missing term that I’m hearing more and more is “embed” or embedding”. I think it’s an important concept and starts to get at a new mode of library services: embedded library instruction, embedded reference services, embedded library web services in the form of widgets and gadgets, etc. Just my thoughts from a cursory scanning… If you have other thoughts about the cil2009 wordcloud, feel free to leave a comment.


What are your patrons doing online?

BusinessWeek has a quick snapshot of U.S. user activities online broken down by task and ages. (The study was conducted by the Forrester Research group.)

Who Participates And What People Are Doing Online

Source: http://www.businessweek.com/magazine/content/07_24/b4038405.htm.

Good news if you are into the web2.o stuff and you work in college libraries. The 18-21 set and 22-26 set are well represented in most task categories. And how about those task categories: Creator, Collector, Spectator, Joiner, Critic, etc. They help to define the possible tasks of web2.0 users. Granted the activities recorded refer to patterns in the web at large, but it gives libraries some guidance as to what our users are doing online. It’s also interesting to note the “Inactives”. There’s a whole population that doesn’t live and breathe the web. I get caught up in the “everybody’s online” thing, so it’s a nice gentle reminder.

The key is honing in on one or two likely applications for your library community and giving them a go. Want to enable the Collectors? Think about an XML feed to pieces of your digital collections. Or what about building a service for the Critics? Build a tagging or a comment/rating system into the catalog or digital collection.

An admission: it’s all fine and good for the student set, but college libraries have other interested parties like faculty and university admin. Part of the library role might be to “coach” these other parties into possible roles they might take up in their web use. A faculty member trying to build a research bibliography seems like the perfect candidate to become a “Collector” once given the right library tool or app. In this setting, outreach and education are still a library web developer’s best friend.