Google Apps Hacks [1 ed.] 9780596515881, 059651588X

Can Google applications really become an alternative to the venerable Microsoft Office suite? Conventional wisdom may sa

323 84 8MB

English Pages 559 Year 2008

Report DMCA / Copyright

DOWNLOAD PDF FILE

Recommend Papers

Google Apps Hacks [1 ed.]
 9780596515881, 059651588X

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
File loading please wait...
Citation preview

Google Apps H a ck s by Philipp Lenssen Publisher : O' Re illy Pub Dat e: Apr il 1 6 , 2 0 0 8 Print I SBN- 13: 9 7 8 - 0 - 5 9 6 - 5 1 5 8 8 - 1 Pages: 3 7 4 Table of Cont ent s | I ndex

Overview Can Google applicat ions really becom e an alt ernat ive t o t he venerable Microsoft Office suit e? Convent ional wisdom m ay say no, but pract ical wisdom says ot herwise. Right now, 100,000 sm all businesses are current ly running t rials of Google office applicat ions. So are large corporat ions such as General Elect ric and Proct or & Gam ble. Google Apps Hacks get s you in on t he act ion wit h several ingenious ways t o push Google's web, m obile, and deskt op apps t o t he lim it . The scores of clever hacks and workarounds in t his book help you get m ore t han t he obvious out of a whole host of Google's web- based applicat ions for word processing, spreadsheet s, PowerPoint - st yle present at ions, em ail, calendar, and m ore by giving you ways t o exploit t he suit e's unique net work funct ionalit y. You get plent y of ways t o t inker wit h:

Google Docum ent s - - Share and edit docum ent s wit h ot hers in real t im e, view t hem on t he run wit h Google Docs m obile service, and use Google Not ebook for web research

Google Spreadsheet s - - Add real- t im e dat a t o spreadsheet s, and generat e chart s and t ables you can em bed in web pages

Google Present at ions - - View t hem on a m obile phone and save t hem as video

Gm ail - - Send em ail t o and from a m obile phone, adj ust Gm ail's layout wit h a st yle sheet , and a lot m ore

iGoogle - - Creat e your own gadget s, program a screenscraper, add Flash gam es, and m ore

Google Calendar - - Add web cont ent event s, public calendars, and your Out look Calendar t o t his applicat ion

Google Reader, Google Maps, Google Eart h, and Google Sket chUp: t he new 3D m odeling soft ware t ool

Picasa, YouTube, and Google Video - - discover new ways t o cust om ize and use t hese m edia m anagem ent apps

I n addit ion, Google Apps Hacks out lines ways you can creat e a sim ple web sit e wit h not hing but Google t ools, including Page Creat or, Blogger, Google Analyt ics, and cont ent from ot her Google apps. This am azing collect ion j ust m ight convince you t hat Microsoft Office is not t he last word in business applicat ions. The price is cert ainly right .

Google Apps H a ck s by Philipp Lenssen Publisher : O' Re illy Pub Dat e: Apr il 1 6 , 2 0 0 8 Print I SBN- 13: 9 7 8 - 0 - 5 9 6 - 5 1 5 8 8 - 1 Pages: 3 7 4 Table of Cont ent s | I ndex

dedicat ion FOREWORD PREFACE MEET THE GOOGLE DOCS FAMI LY Hack 1. How t o Get Your Google Account Hack 2. Collaborat e wit h Ot hers Through Google Docs Hack 3. Make a Deskt op I con t o Creat e a New Docum ent Hack 4. Em bed a Dynam ic Chart int o a Google Docum ent or a Web Page Hack 5. Share Docum ent s wit h a Group Hack 6. Aut om at ically Open Local Files wit h Google Hack 7. Google Docs on t he Run Hack 8. Back Up All Your Google Docs Files Hack 9. Beyond Google: Creat e Docum ent s wit h Zoho, Edit Grid and m ore THE GOOGLE DOCS FAMI LY: GOOGLE DOCUMENTS Hack 10. Let Ot hers Subscribe t o Your Docum ent Changes Hack 11. Blog wit h Google Docs Hack 12. I nsert Special Charact ers I nt o Your Docum ent s Hack 13. Search and Replace Text Using Regular Expressions Hack 14. " Google Docs Light " for Web Research: Google Not ebook Hack 15. Convert a Word File I nt o a PDF wit h Google Docs Hack 16. Writ e a JavaScript Bookm arklet t o Transm ogrify Your Docum ent s Hack 17. Rem ove Form at t ing Before Past ing Text I nt o a Docum ent Hack 18. Pret t ify Your Docum ent wit h I nline St yles THE GOOGLE DOCS FAMI LY: GOOGLE SPREADSHEETS Hack 19. Add Live Dat a t o Your Spreadsheet Hack 20. Pick a Winner at Random Hack 21. Em bed Your Spreadsheet in a Web Page Hack 22. Use Google Spreadsheet s as a Cont ent Managem ent Syst em Hack 23. Show Elapsed Tim e as Days and Hours Hack 24. : Show t he Weekday or Mont h of a Dat e Hack 25. Show t he Difference Bet ween Two Dat es Hack 26. Aut om at ically Com plet e List s of Relat ed I t em s Hack 27. I m port Dat a from Web Sit es Hack 28. Form at Cells According t o Their Values Hack 29. Convert Currencies Wit hin Your Spreadsheet THE GOOGLE DOCS FAMI LY: GOOGLE PRESENTATI ONS Hack 30. Add a Cust om Present at ion Them e Hack 31. Find I m ages for Your Present at ion Hack 32. Shrink Your Present at ion for Easy Sharing Hack 33. Use PowerPoint Tem plat es Hack 34. View Your Present at ion on a Mobile Phone Hack 35. Make Your Present at ions Easy t o Read Hack 36. Em bed a Present at ion in Your Web Page Hack 37. Drag and Drop I m ages from Ot her Web Sit es Hack 38. Save Your Present at ions as Video BECOME A GMAI L POWER USER Hack 39. Send Mail t o Several People at Once Hack 40. I m port Cont act s from Ot her Em ail Program s Hack 41. Adj ust Your Gm ail Layout Hack 42. Change t he Appearance and Behavior of Gm ail Hack 43. Read Gm ail on Your Mobile Phone

Hack 44. Organize Messages as They Arrive Hack 45. Gm ail Drive, Your Online Hard Drive Hack 46. Know Your Gm ail Keyboard Short cut s Hack 47. Make Gm ail Bet t er Hack 48. Back Up Your Em ail Hack 49. At t ach a Google Docs Docum ent t o Your Em ail Hack 50. View Unread Messages Hack 51. I nsert Pseudographical Em ail Signat ures Hack 52. Forward Messages t o Your Cellphone Hack 53. Creat e Spare Gm ail Addresses Hack 54. Search for a Specific Language Hack 55. Link t o Conversat ions, Searches, Labels, and More Hack 56. Beyond Google: Yahoo! Mail, MS Hot m ail, and More CUSTOMI ZE YOUR GOOGLE HOME PAGE Hack 57. Add Google Tools t o iGoogle Hack 58. Chat from iGoogle Hack 59. Creat e Your Own iGoogle Gadget s Quickly Hack 60. Program Your Own iGoogle Gadget Hack 61. Creat e an iGoogle Them e Hack 62. Add Google News t o iGoogle Hack 63. Em bed Cont ent from Any Web Sit e in a Gadget Hack 64. Add Any Flash Gam e as a Gadget Hack 65. Beyond Google: Net vibes, Pageflakes, and More MANAGE YOUR EVENTS WI TH GOOGLE CALENDAR Hack 66. Access Your Calendar from a Mobile Phone Hack 67. Subscribe t o Public Calendars Hack 68. Creat e a To- Do List in Google Calendar Hack 69. Share Calendars Hack 70. Put a Calendar XML Widget in Your Blog Hack 71. Em bed All Kinds of Cont ent in Calendar Event s Hack 72. St yle Your Calendar Hack 73. Quickly Add Event s from Anywhere Hack 74. Know t he Weat her Hack 75. Beyond Google: Yahoo! Calendar and Ot hers KEEP UP ON NEWS WI TH GOOGLE READER Hack 76. Use Google Reader Offline Hack 77. Subscribe t o Google's Feeds Hack 78. Take Your Old Subscript ions wit h You Hack 79. Get Alert s for New Blog Post s Hack 80. Share a Post wit h a Single Short cut Hack 81. Use Google Reader's Mobile Version Hack 82. Track What Wikipedia Says About You Hack 83. Track Your Package Hack 84. Com pare Two Post s t o See t he Changes Hack 85. Beyond Google: Bloglines, Kinj a, and Ot her Feed Readers MANAGE YOUR PHOTOS AND VI DEOS WI TH PI CASA AND YOUTUBE Hack 86. Turn a Picasa Phot o Feed I nt o a Screensaver Hack 87. Link t o a Specific Posit ion Wit hin a Google Video Hack 88. Wat ch Videos on Your Cellphone Hack 89. Opt im ize St ream ing When Em bedding Mult iple YouTube Videos Hack 90. Add Subt it les t o a Google Video Hack 91. Download a YouTube or Google Video Film for Offline Consum pt ion Hack 92. Geot ag Your Phot os and Share Them on Google Maps Hack 93. Resize and Cust om ize Em bedded Videos Hack 94. Disguise Your Picasa I dent it y Hack 95. Display Music Video Lyrics Hack 96. Beyond Google: From Flickr t o Vim eo and Blip.t v CREATE YOUR OWN HOME PAGE, BLOG, OR GROUP Hack 97. Add a Gadget t o Your Google Page ( or Blog) Hack 98. Bat t le Spam in Your Blog Hack 99. Add a Search Engine t o Your Hom e Page Hack 100. Get a Tast e of Blogger's Experim ent al Feat ures Hack 101. Keep a Discussion Thread at t he Top of t he Group Hack 102. Blog Transparent ly

Hack 103. Hide t he Blogspot Navigat ion Bar Hack 104. Monit or a Thread for New Post s Hack 105. Hide t he Ads in Your Google Group Hack 106. Track Who Links t o Your Blog Post s Hack 107. Quickly Share YouTube Videos on Your Blog Hack 108. Generat e Text I m ages Hack 109. Blog via Em ail Hack 110. Out source Your Knowledge Base Host ing Hack 111. Test Your Web Sit e in Ot her Browsers Hack 112. Get a ( Google) Sit e Hack 113. Turn Your Blog I nt o a Book Hack 114. Beyond Google: From WordPress and FriendFeed t o Yahoo's GeoCit ies DI VE I NTO GOOGLE MAPS, GOOGLE EARTH, AND SKETCHUP 3D Hack 115. Drop a Google Map Ont o Your Sit e Hack 116. Add a Gadget t o Google Maps Hack 117. Creat e Your Own Google Maps Layer Hack 118. Enable Advanced Sket chUp Tools Hack 119. Load Plug- ins I nt o Sket chUp Hack 120. View t he Moon and More on Google Maps Hack 121. Creat e Google Maps Overlays On t he Fly Hack 122. Add a Sky t o Google Eart h Hack 123. Add Your Business t o Google Maps Hack 124. Make Your 3D Model More Sket ch- Like Hack 125. Avoid t he Clash of Cont ext Menus Hack 126. Plot Google Calendar Event s on a Google Map Hack 127. Turn Google Eart h I nt o a Flight Sim ulat or Hack 128. Beyond Google: The Yahoo! Maps Web Service, Live Maps, and More GOOGLE ANALYTI CS AND BEYOND: MARKET YOUR SI TE, TRACK VI SI TORS Hack 129. Cust om ize Your Google Analyt ics Dashboard Hack 130. Opt im ize Your Sit e for Search Engines Hack 131. Track t he Traffic of Your iGoogle Gadget s Hack 132. Creat e a Firefox Keyword t o Skip t he Analyt ics Login Box Hack 133. Export Your Analyt ics Traffic t o Google Spreadsheet s Hack 134. Prom ot e Your Sit e Using Google Gadget s Hack 135. Roll Your Own Analyt ics API for a " Most Popular Post s" Widget Hack 136. Conduct a User Survey Hack 137. Visualize Traffic wit h DI Y Vect or Graphics Hack 138. Talk t o Your Visit ors Hack 139. A Different Display for Google Analyt ics Hack 140. Follow t he Online Discussion Hack 141. Beyond Google: Clicky, Mint , and Ot hers CREDI TS I ndex

GOOGLE APPS H ACKS by Ph ilipp Le n sse n Copyright © 2008. All right s reserved. Print ed in U.S.A. Published by Make: Books, an im print of Maker Media, a division of O'Reilly Media, I nc. 1005 Gravenst ein Highway Nort h, Sebast opol, CA 95472. O'Reilly books m ay be purchased for educat ional, business, or sales prom ot ional use. For m ore inform at ion, cont act our corporat e/ inst it ut ional sales depart m ent : 800- 998- 9938 or corporat [email protected] . Pr in t H ist or y April 2008 First Edit ion Pu blish e r : Dale Doughert y Associa t e Pu blish e r : Dan Woods Edit or : Brian Jepson Cr e a t ive D ir e ct or : Daniel Cart er D e sign e r : Anne Mellinger Pr odu ct ion M a n a ge r : Terry Bronson Copy Edit or : Nancy Kot ary I n de x e r : Pat t i Schiendelm an Cove r Ph ot ogr a ph : Daniel Cart er The O'Reilly logo is a regist ered t radem ark of O'Reilly Media, I nc. The Hacks series designat ions, Google Apps Hacks, and relat ed t rade dress are t radem arks of O'Reilly Media, I nc. The t radem arks of t hird part ies used in t his work are t he propert y of t heir respect ive owners. I m port ant Message t o Our Readers: While every precaut ion has been t aken in t he preparat ion of t his book, t he publisher and aut hors assum e no responsibilit y for errors or om issions, or for dam ages result ing from t he use of t he inform at ion cont ained herein. The t echnologies discussed in t his publicat ion, t he lim it at ions on t hese t echnologies t hat t echnology and cont ent owners seek t o im pose, and t he laws act ually lim it ing t he use of t hese t echnologies are const ant ly changing. Thus, som e of t he hacks described in t his publicat ion m ay not work, m ay cause unint ended harm t o syst em s on which t hey are used, or m ay not be consist ent wit h applicable user agreem ent s. Your use of t hese hacks is at your own risk, and O'Reilly Media, I nc. disclaim s responsibilit y for any dam age or expense result ing from t heir use. I n any event , you should t ake care t hat your use of t hese hacks does not violat e any applicable laws, including copyright laws.

I SBN- 10: 0- 596- 51588- X I SBN- 13: 978- 0- 596- 51588- 1

de dica t ion To D. & C.

FOREW ORD Google. That 's t he search place, right ? Not anym ore. Today, Google is like a m egast ore offering product s and services of all t ypes. Sure, it st ill has search—but it doesn't st op t here. Google can be your office; your answering service; your secret ary. I t can bring you t he news each day, report on how your business is perform ing, and provide you wit h ent ert ainm ent when t he day is done. Best of all, virt ually all of t hese services are free—and t hat 's beginning t o dram at ically change our lives. I rem em ber t he shock of how expensive m y first com put er was when I bought it in 1985—and how shock t urned t o horror as I cont em plat ed t he cost of soft ware. As a college st udent , I couldn't afford it . I borrowed copies, like so m any ot hers. Aft er college, I st art ed buying m y own soft ware. But even wit h a good j ob, it was an expensive out lay t o equip m yself wit h a word processor and a spreadsheet , as well as an elect ronic organizer. Expensive dat abase soft ware? Forget it . But wit hout soft ware, our com put ers are lum ps of m et al and plast ic. Soft ware is what let s us harness a com put er's power t o do m any t hings fast er, bet t er or m ore creat ively t han wit hout digit al help. Ent er Google. I f I were in college t oday, I 'd no longer need t o borrow word processing soft ware. Google gives it t o m e, free of charge. And spreadsheet s. And not epads. And a calendar, and an em ail address book—not t o m ent ion nearly unlim it ed st orage of m y act ual em ail. Heck, using Google's product s and services, I can st art a business on a shoest ring budget . The birt h of t he personal com put er liberat ed m illions from t he " priest hood" of program m ers t hat wat ched over t he big m ainfram es of t he past . PCs ( I BM PCs, Windows m achines, Macs, and com put ers running ot her operat ing syst em s) let ordinary people t ap int o a com put er's power. But t he liberat ion m ovem ent didn't end wit h t he PC. The em ergence of t he Web let m illions slip around t he gat ekeepers of big publishers and m edia out let s. Anyone could speak out and develop a st rong voice at lit t le t o no cost . Liberat ion cont inues as part of t he web applicat ion m ovem ent . Free web apps—soft ware requiring no painful inst allat ion process—let m illions creat e inform at ion and access it from anywhere. Qualit y t ools no longer have t o be obt ained at high cost . The price barrier, like t he com put er priest hood and t he m edia gat ekeepers, has been swept aside—and m uch credit goes t o t he charge t hat Google has led. The glorious revolut ion hasn't produced ut opia, however. The downside t o Google offering so m any product s in such a short t im e is t hat you m ay find t hat t hey're m issing feat ures you want . But because as free apps t hey don't generat e revenue t hrough a process of cont inual upgrades, it can t ake a long t im e for feat ures t o appear. I 'm st ill wait ing for t he feat ure t hat let s m e see m ore t han 100 em ails at one t im e in Gm ail—how hard can it be? Ent er t his book. I f t he soft ware's not doing what it should, hack it ! Find a workaround, a pat ch, or an add- on. Philipp Lenssen has assem bled an am azing num ber of ways t o m ake Google Apps do what you want —or t o do t hings you didn't know you want ed t hem t o do unt il he showed you how. I n addit ion, he also t akes t he apps furt her by com bining t hem . Google's m any apps are alm ost like having access t o a web- based Erect or Set . You can link pieces of apps t oget her t o creat e new and unusual creat ions. Viva t he revolut ion! Viva t he revolut ionary's m anual! Get hacking! — Danny Sullivan, Chit t erne, UK Danny Sullivan is t he edit or of t he popular news sit e SearchEngineLand.com and organizer of t he SMX: Search Market ing Expo conference series. He's been involved in covering search engines dat ing back t o t he pre- Google era of t he m id- 1990s.

PREFACE 0.15 seconds. That 's t he t im e it j ust t ook Google t o ret urn 100 search result s from t he Web for a random word. Google searches t hrough billions of docum ent s, and it has m asses of people using it every second. 13 m inut es, 48 seconds. That 's t he t im e it j ust t ook Microsoft Windows t o ret urn 100 search result s on t his PC for t he sam e random word. My Windows searches t hrough t housands of docum ent s, and it has only a single user t oday ( m e) . More t han 13 m inut es' difference is a long t im e; if you're working in a hurried office, it 's t he crucial separat ion bet ween " Yeah, it works," and " I 'll j ust t ry t o find t he docum ent m yself." What separat es t he first process from t he second? I t 's not only t he num ber of sm art engineers caring about search engine t echnology. I t 's also t he fact t hat when you're using Google, you're not using your own com put er, but t he eart h's biggest supercom put er inst ead. This supercom put er is it self m ade up of t ens or hundreds of t housands of sm aller com put ers, spread all over t he globe; m any perhaps resem bling your own com put er in power. But connect t hem , and you end up wit h t he ult im at e t ool t o run applicat ions. Search, it t urns out , is j ust one of t hese applicat ions—and t he Google engineers realized t his t oo, a while ago.

H a ck . Google 's Apps—a Google Office , or a Google OS? Today, Google is growing it s apps suit e t o what people have st art ed t o call a Google Office, or even a Google Operat ing Syst em . I t act ually has feat ures of bot h. There's a plat form called iGoogle t o run your own sm all program s ( which in t urn are called gadget s) . There's a word processor ( Google docum ent s) and a kind of online Excel ( Google Spreadsheet s) . There's a filesyst em explorer t hat 's found in t he Google Docs program . The Google Gears program expands your browser so t hat you can use web applicat ions even when you're offline. Google Calendar let s you m anage your event s. Gm ail let s you m anage your em ail. Google Sket chUp let s you creat e 3D scenery. Google's YouTube host s your video collect ion. Google Maps shows you inform at ion m apped in space, using sat ellit e im agery, driving direct ions, and even det ailed st reet view phot os. And t here's m uch m ore in t his Google apps suit e. However, m ost of t hese aren't deskt op applicat ions you inst all: t hey're host ed online. This approach brings wit h it som e pros and cons. On t he upside, not only won't you need t o inst all t hese web applicat ions; you don't need t o care about get t ing t he lat est soft ware pat ch, eit her. Also, as is t he case wit h m ost of Google's web apps, t hey're free t o use ( as t hey're part ly ad- financed) . And t hese online t ools are very collaborat ive in nat ure—inst ead of edit ing t he Word file all on your own, Google Docs allows you t o edit along wit h ot hers, sim ult aneously. And when you're finished creat ing a docum ent , you won't save it locally t o send out t he at t achm ent , but inst ead can sim ply point som eone t o t he URL of where your docum ent is host ed. There are som e downsides t oo. Microsoft ( am ong ot hers who provide office suit es) , alt hough not a leader in searching, has im m ense experience in deskt op applicat ions. Excel, PowerPoint , Out look, and ot hers are feat urerich, and t hanks t o t he advanced deskt op m odel, t he int erface can support m any t ricks and nicet ies t hat are st ill hard t o em ulat e in t he browser. Google can cert ainly be expect ed t o expand t heir t ools over t im e. But t oday, alm ost universally across applicat ions, Microsoft Office wins when it com es t o t he sheer quant it y of feat ures. An d t h a t 's w h e r e t h is book com e s in . There's a long t radit ion in com put ing t hat when t here's a m issing feat ure, you apply a hack t o m ake t he program do what you want . Aft er all, soft ware—t he deskt op m odel, or t he new online m odel—is supposed t o do t he work for you, not t he ot her way round. I n Google Apps Hacks, we'll be present ing you wit h a wide array of hacks t hat guide you t hrough get t ing m ore out of t his new applicat ion suit e. From easier workarounds ( how do I at t ach a Google docum ent t o an em ail?) , t o m ore advanced t ips ( how do I skin m y Gm ail client ?) , t o program m ing guides ( how do I use t he importXml funct ion in m y spreadsheet ?) . We'll also int roduce t he m ore exot ic program s of t he Google apps suit e, like

Google Not ebook, and provide you wit h approaches t o apply t o your proj ect s. Google apps, it t urns out , have t heir own " 13 m inut es" problem s every once in a while; hopefully, by using t hese hacks, you'll be able t o rout e around som e of t hem .

H a ck . H ow t o Use Th is Book You can read t his book from cover t o cover if you like, but each hack st ands on it s own, so feel free t o browse and j um p t o t he different sect ions t hat int erest you m ost . I f t here's a prerequisit e t hat you need t o know about , a cross- reference will guide you t o t he right hack.

H a ck . H ow Th is Book I s Or ga n ize d This book is int ended t o be a com pendium of t ricks and t ricks for life in t he age of ( Google) web apps. Beyond t his, we hope you will gain a broader underst anding of how t he various part s of t he " Google office" int erconnect ( indeed, alt hough t he great variet y of Google t ools offered allows you t o t ackle t asks in m any different ways, t his sam e variet y can also be confusing) . Google Apps Hacks is organized int o 12 chapt ers:

Chapt er 1 , Meet t he Google Docs Fam ily

Google Docs is t he nam e for t he Google suit e t hat includes docum ent , spreadsheet , and present at ion edit ing. I n t his chapt er, you will find inform at ion relat ed t o all t hree of t hem , as well as t he Google Docs explorer t ool in general. You learn how t o m ake t he best use of docum ent sharing, how t o connect Google Docs t o your deskt op, how t o do backups, and m ore.

Chapt er 2 , The Google Docs Fam ily: Google Docum ent s

The Google docum ent edit or is t he Word of web apps. Form erly nam ed Writ ely, t his applicat ion allows you t o creat e all kinds of docum ent s, wit h a focus on sharing and t eam edit ing capabilit ies. I n Chapt er 2 you will find out about t hings like replacing t ext using regular expressions, file conversions, and Cascading St yle Sheet s t o pret t ify your docum ent .

Chapt er 3 , The Google Docs Fam ily: Google Spreadsheet s

Google Spreadsheet s is Google's spreadsheet web edit or. Along wit h num erous funct ionalit ies t hat you m ay know from deskt op t ools such as Microsoft Excel, Google Spreadsheet s also allows you t o connect cells t o live inform at ion cont ained on t he Web, which Chapt er 3 discusses—am ong m any ot her hacks.

Chapt er 4 , The Google Docs Fam ily: Google Present at ions

The web t ool t hat 's code- nam ed " Present ly" is t he new kid on t he block of Google Docs. While it 's a rat her fresh addit ion lacking feat ures of m ore powerful t ools like PowerPoint , it already offers som e solid base feat ures. We'll t ake a look int o som e of t he base feat ures, as well as advanced uses of t he present at ions app.

Chapt er 5 , Becom e a Gm ail Power User

Gm ail was originally released on April 1, 2004, causing m any people t o believe t hat it s t hen 1 GB of st orage m ust be a j oke. Since t hat day, m any people have st art ed t o use Gm ail as t heir m ain em ail applicat ion, and som e of t hese users also built t heir own funct ionalit y on t op of Google Mail using Greasem onkey script s. We'll discuss t hese script s as well as ot her Gm ail hacks, like user st ylesheet edit ing, in dept h.

Chapt er 6 , Cust om ize Your Google Hom e Page

The iGoogle variant of t he Google hom e page is a bit of a fridge door on which you can st ick all kind of m agnet s: a calendar, your lat est m ail, your t o- do list , a phot o, or som et hing else plain fun. I n Chapt er 6 , you'll find out how t o program gadget s and creat e t hem using wizards, as well as how t o creat e cust om t hem es. We'll also show m any of t he int erest ing available gadget s.

Chapt er 7 , Manage Your Event s wit h Google Calendar

This chapt er offers hacks on such subj ect s as creat ing a t o- do list , sharing and finding of calendars, t aking t he quick add box of GCal wit h you, and connect ing your m obile phone t o your event s.

Chapt er 8 , Keep Up on News wit h Google Reader

I f you haven't used an " RSS reader" before ( or if you are considering swit ching from your current one) , you m ight want t o give Google Reader a t ry. Som e of t he advanced uses and hacks are illust rat ed in Chapt er 8 . You'll learn about Google Gears, which adds offline capabilit ies t o Reader, package t racking and Wikipedia art icle t racking, alert s, and t he m any locat ions at which Google offers feeds for t heir t ools.

Chapt er 9 , Manage Your Phot os and Videos wit h Picasa and YouTube

Chapt er 9 covers Google's Picasa Web Album s, Google- owned YouTube, and Google Video. I f you want t o find out m ore about how t o add your pics and videos t o t he Web, you m ight find useful hacks like linking t o a specific t im e wit hin a Google Video, adding subt it les t o a video, displaying t he lyrics for a m usic video, " geot agging" your phot os, and m ore.

Chapt er 10, Creat e Your Own Hom e Page, Blog, or Group

Creat ing and m aint aining your own sit e is a t opic t hat could span a whole book. Or perhaps a whole bookshelf. I n Chapt er 10, we've picked som e of t he m ost int erest ing use cases for hacking Google's Blogger, Google Groups, and Google Page Creat or. You also get t o know Google Sit es, t he form er Jot Spot , which allows you t o set up wiki- st yle int ranet or I nt ernet dest inat ions.

Chapt er 11, Dive int o Google Maps, Google Eart h, and Sket chUp 3D

Google Maps and it s deskt op sibling Google Eart h squeeze t he Eart h—and t he universe, as ht t p: / / sky.google.com shows—int o your browser. This chapt er discusses ways t o em bed a Google m ap ont o your own sit e; t ips on using Google Sket chUp 3D, which allows you t o add m odels t o Google Eart h; program m at ically creat ing Keyhole Markup Language layers on t op of m aps; and m ore.

Chapt er 12, Google Analyt ics and Beyond: Market Your Sit e, Track Visit ors

What 's t he best publicat ion wit hout visit ors t o see it ? A very lonely publicat ion, I guess. By analyzing your t raffic wit h Google Analyt ics, you can opt im ize your sit e for your visit ors, whet her you built a t radit ional hom e page, a weblog, or anyt hing else. I n Chapt er 12, you will find out how t o t rack iGoogle gadget t raffic, how t o cust om ize your Google Analyt ics dashboard, how t o add a live chat t o get t o know your visit ors bet t er, and m ore.

For every set of apps, a Beyond Google sect ion gives you a broad overview for som e of t he valuable t ools in t he area offered by t he Google com pet it ion.

H a ck . Con ve n t ion s Use d in Th is Book This book uses t he following t ypographical convent ions:

I t alic

Used t o indicat e new t erm s, URLs, filenam es, file ext ensions, direct ories, and folders.

Constant width

Used t o show code exam ples, verbat im searches and com m ands, t he cont ent s of files, and t he out put from com m ands.

Pay special at t ent ion t o not es set apart from t he t ext wit h t he following icons:

N OTE This icon indicat es a t ip, suggest ion, or general not e. I t cont ains useful supplem ent ary inform at ion or an observat ion about t he t opic at hand.

This icon indicat es a warning or not e of caut ion.

The slider icons, found next t o each hack, indicat e t he relat ive com plexit y of t he hack: Easy: I nt erm ediat e: Expert :

Usin g Code Ex a m ple s This book is here t o help you get your j ob done. I n general, you m ay use t he code in t his book in your program s and docum ent at ion. You do not need t o cont act us for perm ission unless you're reproducing a significant port ion of t he code. For exam ple, writ ing a program t hat uses several chunks of code from t his book does not require perm ission. Selling or dist ribut ing a CD of exam ples from O'Reilly books does require perm ission. Answering a quest ion by cit ing t his book and quot ing exam ple code does not require perm ission. I ncorporat ing a significant am ount of exam ple code from t his book int o your product 's docum ent at ion does require perm ission. We appreciat e, but do not require, at t ribut ion. An at t ribut ion usually includes t he t it le, aut hor, publisher, and I SBN. For exam ple: " Google Apps Hacks, by Philipp Lenssen. Copyright 2008 O'Reilly Media, I nc., 978- 0- 59651588- 1." I f you feel your use of code exam ples falls out side fair use or t he perm ission given here, feel free t o cont act us at perm [email protected] .

H a ck . Ack n ow le dgm e n t s Th a n k s t o everyone at O'Reilly who helped m ake t his book happen, including Brian Sawyer, who was t here in t he earliest phase; Dale Doughert y; Nancy Kot ary, copyedit or; Terry Bronson, product ion m anager; Pat t i Schiendelm an, indexer; Anne Mellinger, designer; and Daniel Cart er, cover designer. A hat t ip t o Tim O'Reilly. My biggest t hanks of all goes t o Brian Jepson for his t errific and ext ensive work in edit ing t he book. Brian's not only an expert wordsm it h, but also has a great t echnical underst anding, and he m olded t his book int o a t rue O'Reilly publicat ion. Th a n k s t o Mot t i St rom ( Mobile Soft ware Engineer at Google UK) , Piot r Konieczny (ht t p: / / blog.konieczny.be) , Adam Sah, Bryan Burkholder, and Siggi Becker ( ht t p: / / siggibecker.de) , who all sent t ips for t he book. I onut Alex. Chit u from Rom ania also sent point ers, and his blog (ht t p: / / googlesyst em .blogspot .com ) cont inues t o be a t errific resource for all kinds of Google- relat ed t ips and t ricks. For t heir hack cont ribut ions, a big t hanks t o Tony Hirst , Ret o Meier, and Chris Riley. Thanks t o m y wife and fam ily for t he support . Spe cia l t h a n k s t o e ve r yon e a t Google Blogoscope d for sharing news and t ips via em ail and in t he forum or helping out ot herwise, including, but by far not lim it ed t o, Haochi Chen, Search- Engines- Web.com , I onut ( again) , Brinke Gut hrie, Tom HTML, Luka, Pet er Dawson, Colin Colehour, David Het field, Mat hias Schindler, Jam es Xuan, Hebbet , Manoj Nahar, Juha- Mat t i Laurio, Tadeusz Szewczyk, Sohil, Mam bo, Mrrix32, Art - One, I anF, St efan2904, Roger Browne, Mart in Porcheron, Niraj Sanghvi, Kirby Wit m er, Myst erius, Set h Finkelst ein, Alek Kom arnit sky, Rohit Srivast wa, Josue R., Orli, Beussery, Veky, JohnMu, Hong Xiaowan as well as all Chinese t ranslat ors of Google Blogoscoped, Jared, Keit h Chan, and Ram ibot ros ( a longer list is at ht t p: / / blogoscoped.com / forum / personrank.ht m l) . Last not least , t hanks t o t he Google Blogoscoped co- edit or Tony Ruscoe from Sheffield, UK. When ot hers t ake a coffee break, you can find him digging around Google source code t o find not ewort hy bit s and pieces.

H a ck . W e 'd Lik e t o H e a r fr om You Please address com m ent s and quest ions concerning t his book t o t he publisher: O'Reilly Media, I nc./ Maker Media, I nc. 1005 Gravenst ein Highway Nort h Sebast opol, CA 95472 ( 800) 998- 9938 ( in t he Unit ed St at es or Canada) ( 707) 829- 0515 ( int ernat ional or local) ( 707) 829- 0104 ( fax) We have a web page for t his book t hat list s errat a, exam ples, and any addit ional inform at ion. You can access t his page at : ht t p: / / www.m akezine.com / go/ gappshacks. To com m ent or ask t echnical quest ions about t his book, send em ail t o bookquest [email protected] . Maker Media is a division of O'Reilly Media devot ed ent irely t o t he growing com m unit y of resourceful people who believe t hat if you can im agine it , you can m ake it . Consist ing of Make Magazine, Craft Magazine, Maker Faire, and t he Hacks series of books, Maker Media encourages t he Do- I t - Yourself m ent alit y by providing creat ive inspirat ion and inst ruct ion. For m ore inform at ion about Maker Media, visit us online: MAKE: www.m akezine.com CRAFT: www.craft zine.com Maker Faire: www.m akerfaire.com Hacks: www.hackszine.com

M EET TH E GOOGLE D OCS FAM I LY Google D ocs ( ht t p:/ / docs.google .com ) is t h e t it le of Google 's t e x t , spr e a dsh e e t , a n d pr e se n t a t ion e dit or , sim ila r in st yle t o M icr osoft 's W or d, Ex ce l, a n d Pow e r Poin t pr ogr a m s, bu t w it h fe w e r fe a t u r e s, a n d a st r on ge r focu s on colla bor a t ion . W it h Google D ocs, you ca n w r it e le t t e r s, r e cipe s, t u t or ia ls, a dia r y, book ch a pt e r s—I 'm u sin g it t o w r it e t h is book —or a n yt h in g e lse . You can also creat e web pages, t hanks t o t he export opt ions t hat Google Docs provides. Google Spreadsheet s, on t he ot her hand, allows you t o perform spreadsheet calculat ions; you can keep any num eric or t ext ual dat a organized—from t he prices of it em s in your ant ique collect ion t o t he age and address of your em ployees, and so on. Google Spreadsheet s provides you wit h a variet y of form ulas t o perform calculat ions wit hin a spreadsheet . You can also creat e neat visualizat ions using t he chart t ool. Google Present at ions, t he last of t he t rio, is useful for creat ing present at ion slides for online or offline use. To sign up for t his service, as is t he case wit h m ost ot her Google services described t hroughout t he book, you need a Google Account .

H a ck 1 . H ow t o Ge t You r Google Accou n t You can creat e a Google Account t hrough m any of Google's services. The easiest way is t o go t o ht t p: / / www.gm ail.com and click t he " Sign up for Gm ail" link. ( Not e t hat if you already have Gm ail, you also already have a Google Account .) During t he sign- up process, you provide your first and last nam e and your preferred usernam e, along wit h ot her inform at ion, as shown in Figure 1- 1. Once you agree t o t he Term s of Service and com plet e t he sign- up by clicking t he " I accept " but t on, you'll see a Congrat ulat ions page. Now you can log in t o m ost Google services using your em ail + password.

N OTE I f your em ail address is a gm ail address, such as " officehacks@gm ail.com " , it 's enough t o ent er j ust " officehacks" ( along wit h your password) when you want t o log in t o your Google Account .

Log I n t o Google D ocs Now you can go t o ht t p: / / docs.google.com and log in t o Google Docs. Aft er you log in, you will see your file explorer, pict ured in Figure 1- 2. On t he left side you can find different views of your it em s, and you can also see a list of people you have shared your it em s wit h; on t he right side, you will see your files, if you have any. To creat e a new docum ent —" docum ent " is Google's nam e for a word processing file—click t he New but t on in t he t op left and pick Docum ent . A new browser window wit h t he docum ent edit or appears, as shown in Figure 13 —now you can st art writ ing, insert ing im ages, creat ing t ables, and m ore. Click anywhere on t he docum ent t it le t o change it s nam e, and t hen save t he file. By default , unless you share t he file wit h ot hers, your docum ent is privat e. I t is, however, st ored on Google's servers. ( I t would also be visible t o anyone who's able t o guess your password, so m ake sure t hat you use a st rong password—m ore t han j ust a single word, for inst ance.)

Cr e a t in g a Google Accou n t

Th e Google D ocs file e x plor e r

Google Spreadsheet s, shown in Figure 1- 4, has a sim ilar look and feel t o t he Google docum ent edit or. One key difference is t hat it aut om at ically saves your changes as you m ake t hem . Google Present at ions, pict ured in Figure 1- 5, allows you t o prepare a new present at ion and, t o som e ext ent , im port an exist ing Microsoft PowerPoint present at ion. I t reuses int erface elem ent s from t he docum ent and spreadsheet s edit or.

Th e Google D ocs e dit or

Th e Google Spe a dsh e e t s e dit or

Th e Google Pr e se n t a t ion s e dit or

N OTE Som et im es you m ay not inst ant ly see t he docum ent you saved when you swit ch back t o t he Google Docs file explorer. To refresh t he window, click your browser's refresh but t on, and you will find your docum ent s view has been updat ed. I f you have a problem wit h Google docum ent s, Spreadsheet s, or Present at ions, t he best place t o find help—aft er you've checked t he Google Docs help file, t hat is—is t he official Google help group on t he subj ect . Go t o ht t p: / / groups.google.com / group/ GoogleDocs, click t he " Join t his group" link, and pose your quest ion in one of t he different sect ions, like " How do I . . . ?" ( for general quest ions) or " Som et hing is Broken" ( when you t hink you've discovered a bug) . I f a Google em ployee answers, you will find a square " G" icon next t o t he m em ber's nam e, but advice from nonem ployees can be superb t oo.

M EET TH E GOOGLE D OCS FAM I LY Google D ocs ( ht t p:/ / docs.google .com ) is t h e t it le of Google 's t e x t , spr e a dsh e e t , a n d pr e se n t a t ion e dit or , sim ila r in st yle t o M icr osoft 's W or d, Ex ce l, a n d Pow e r Poin t pr ogr a m s, bu t w it h fe w e r fe a t u r e s, a n d a st r on ge r focu s on colla bor a t ion . W it h Google D ocs, you ca n w r it e le t t e r s, r e cipe s, t u t or ia ls, a dia r y, book ch a pt e r s—I 'm u sin g it t o w r it e t h is book —or a n yt h in g e lse . You can also creat e web pages, t hanks t o t he export opt ions t hat Google Docs provides. Google Spreadsheet s, on t he ot her hand, allows you t o perform spreadsheet calculat ions; you can keep any num eric or t ext ual dat a organized—from t he prices of it em s in your ant ique collect ion t o t he age and address of your em ployees, and so on. Google Spreadsheet s provides you wit h a variet y of form ulas t o perform calculat ions wit hin a spreadsheet . You can also creat e neat visualizat ions using t he chart t ool. Google Present at ions, t he last of t he t rio, is useful for creat ing present at ion slides for online or offline use. To sign up for t his service, as is t he case wit h m ost ot her Google services described t hroughout t he book, you need a Google Account .

H a ck 1 . H ow t o Ge t You r Google Accou n t You can creat e a Google Account t hrough m any of Google's services. The easiest way is t o go t o ht t p: / / www.gm ail.com and click t he " Sign up for Gm ail" link. ( Not e t hat if you already have Gm ail, you also already have a Google Account .) During t he sign- up process, you provide your first and last nam e and your preferred usernam e, along wit h ot her inform at ion, as shown in Figure 1- 1. Once you agree t o t he Term s of Service and com plet e t he sign- up by clicking t he " I accept " but t on, you'll see a Congrat ulat ions page. Now you can log in t o m ost Google services using your em ail + password.

N OTE I f your em ail address is a gm ail address, such as " officehacks@gm ail.com " , it 's enough t o ent er j ust " officehacks" ( along wit h your password) when you want t o log in t o your Google Account .

Log I n t o Google D ocs Now you can go t o ht t p: / / docs.google.com and log in t o Google Docs. Aft er you log in, you will see your file explorer, pict ured in Figure 1- 2. On t he left side you can find different views of your it em s, and you can also see a list of people you have shared your it em s wit h; on t he right side, you will see your files, if you have any. To creat e a new docum ent —" docum ent " is Google's nam e for a word processing file—click t he New but t on in t he t op left and pick Docum ent . A new browser window wit h t he docum ent edit or appears, as shown in Figure 13 —now you can st art writ ing, insert ing im ages, creat ing t ables, and m ore. Click anywhere on t he docum ent t it le t o change it s nam e, and t hen save t he file. By default , unless you share t he file wit h ot hers, your docum ent is privat e. I t is, however, st ored on Google's servers. ( I t would also be visible t o anyone who's able t o guess your password, so m ake sure t hat you use a st rong password—m ore t han j ust a single word, for inst ance.)

Cr e a t in g a Google Accou n t

Th e Google D ocs file e x plor e r

Google Spreadsheet s, shown in Figure 1- 4, has a sim ilar look and feel t o t he Google docum ent edit or. One key difference is t hat it aut om at ically saves your changes as you m ake t hem . Google Present at ions, pict ured in Figure 1- 5, allows you t o prepare a new present at ion and, t o som e ext ent , im port an exist ing Microsoft PowerPoint present at ion. I t reuses int erface elem ent s from t he docum ent and spreadsheet s edit or.

Th e Google D ocs e dit or

Th e Google Spe a dsh e e t s e dit or

Th e Google Pr e se n t a t ion s e dit or

N OTE Som et im es you m ay not inst ant ly see t he docum ent you saved when you swit ch back t o t he Google Docs file explorer. To refresh t he window, click your browser's refresh but t on, and you will find your docum ent s view has been updat ed. I f you have a problem wit h Google docum ent s, Spreadsheet s, or Present at ions, t he best place t o find help—aft er you've checked t he Google Docs help file, t hat is—is t he official Google help group on t he subj ect . Go t o ht t p: / / groups.google.com / group/ GoogleDocs, click t he " Join t his group" link, and pose your quest ion in one of t he different sect ions, like " How do I . . . ?" ( for general quest ions) or " Som et hing is Broken" ( when you t hink you've discovered a bug) . I f a Google em ployee answers, you will find a square " G" icon next t o t he m em ber's nam e, but advice from nonem ployees can be superb t oo.

H a ck 2 . Colla bor a t e w it h Ot h e r s Th r ou gh Google D ocs Wit h Google Docs, you can collaborat e wit h ot hers on t he sam e docum ent at t he sam e t im e, and m ake docum ent s accessible t o t he world wit hin seconds by publishing t hem on t he Web. Online applicat ions are born t o be collaborat ive—t he program and t he dat a it works on are already pot ent ially accessible from all over t he world. Plus, every user will see t he sam e version of t hat program wit hout having t o worry about whet her t hey've inst alled all t he lat est pat ches, because t he soft ware runs on Google's servers, which aut om at ically pick up t he lat est bug fixes and new feat ures. This collaborat ive approach requires you t o do a bit of ret hinking if you're used t o deskt op office t ools. I nst ead of sending som eone an at t achm ent , invit e t hem t o a Google docum ent . I nst ead of discussing a spreadsheet via t he phone, em ail, or inst ant m essenger, use t he chat funct ion t hat 's built int o Google Spreadsheet s ( see " Sharing a Spreadsheet ," lat er in t his hack) . I nst ead of set t ing up t hird- part y screen sharing soft ware, you can invit e ot hers t o your present at ion URL and flip t he slides for t hem . I ronically, by being cent ralized, t he dat a act s m ore as if it 's decent ralized; as t he files are st ored on Google's servers, which are already accessible t o ot hers who provide t he needed credent ials ( t heir Google Account ) , Google ensures t hat you don't need t o creat e a copy of a file t o have som eone else see it . So inst ead of dozens of Microsoft Word files scat t ered around your t eam 's PCs ( or in different folders on your int ranet ) , t he Google docum ent exist s only in t hat virt ual " com put ing cloud." And Google Docs t racks who edit s it , can alert you of changes, and allows you t o com pare docum ent revisions. Ge t Fe e dba ck on a D ocu m e n t You 'r e W or k in g On One com m on use of collaborat ion is t o ask for feedback on a docum ent you're edit ing. Your friend, colleague, edit or, or boss can add com m ent s t o your docum ent , which you can work wit h in t urn. All your collaborat or needs for t his is a Google Account , as discussed in t he beginning of t his chapt er. ( Wit hout a Google Account , ot hers can only view your docum ent s—t hey cannot m odify t hem .) Let 's st art by creat ing a Google Docs docum ent at ht t p: / / docs.google.com . Nam e it " Thai Chicken Recipe." To get t he init ial recipe, you can go t o Google Base at ht t p: / / base.google.com and click t he Recipes link; next , select t he cuisine, m ain ingredient , and m ore from t he drop- down m enus, as pict ured in Figure 1- 6, and choose your preferred dish. You can highlight , copy, t hen past e t he full page cont ent direct ly int o your em pt y Docs docum ent as shown in Figure 1- 7. I f you like t o eat but you're no m ast er cook, you can now invit e your m ast er cook friend t o t he docum ent t o proofread it . ( None of your friends can cook Thai? Visit Google's social net work at ht t p: / / orkut .com and j oin t he 6,500+ m em ber- st rong " Thai food lovers" com m unit y.) To invit e your friend, click Share " Share wit h ot hers" on t op of t he edit or. Ent er your friend's em ail address—preferably t heir Gm ail address—int o t he invit at ion box. ( And uncheck t he " I nvit at ions m ay be used by anyone" box, j ust in case som eone else m anages t o get t heir hands on t he invit at ion.) When you click t he " I nvit e collaborat ors" but t on, your friend get s an em ail m essage, shown in Figure 1- 8, and can st art t o edit along.

Google Ba se st or e s u se r r e cipe s, a m on g ot h e r st r u ct u r e d da t a

Aft e r copyin g t h e Th a i Ba sil Ch ick e n r e cipe in t o t h e D ocs e dit or

When you have a docum ent open, you can see if som eone else is edit ing it at t he sam e t im e, t hanks t o t he orange " Also edit ing now . . ." m essage at t he bot t om . Alm ost inst ant ly, when som eone else updat es t he docum ent , t he docum ent you're viewing will change as well, as shown in Figure 1- 9. I f you're not happy wit h a " Revision hist ory" and click t he link of t he last revision you agreed wit h; t hat revision, you can swit ch t o File revision will com e up in t he Google Docs edit or for you t o review, and you can click t he " Revert t o t his one" but t on if you'd like. You can also rem ove collaborat ors at any t im e, using t he Share set t ings.

N OTE Alt hough you cannot direct ly chat wit h your collaborat ors wit hin t he Google Docs docum ent edit or, you can visit ht t p: / / t alk.google.com t o open a separat e, browser- based chat window for background discussions.

A NOTE OF CAUTI ON By using t he Revision hist ory, collaborat ors wit h whom you share a docum ent will also be able t o see versions of t he docum ent m ade before you shared it . I f you want t o avoid t his, you can m ake a copy of your docum ent , and t hen only share t he copy.

An in vit a t ion t o e dit a lon g in t h e sa m e Google docu m e n t

A colla bor a t or r e m ove d som e of t h e or igin a l r e cipe t e x t

Pu blish in g a D ocu m e n t for All t o Se e I nst ead of grant ing som e people perm ission t o m odify your docum ent , you can also publish a docum ent for t he whole world t o see by clicking Share Publish as web page Publish docum ent . You will t hen be provided wit h a URL like t he following:

ht t p: / / docs.google.com / Doc?id= dfp37t n_2g8xrt z Depending on what you choose, t his web page will now eit her host a st at ic version of t he docum ent from t he t im e you published it , or it will be up- t o- dat e t o reflect your lat est changes ( see t he " Aut om at ically re- publish . . ." checkbox in t he " Share" set t ings) . Readers don't need a Google account t o view t his plain web page. Sh a r in g a Spr e a dsh e e t Spreadsheet sharing is even m ore powerful t han sharing a docum ent , because not only will ot hers be able t o edit t he dat a wit h you sim ult aneously, t here's also a chat box at t ached t o t he right side of t he spreadsheet . To share t he docum ent , you first invit e collaborat ors from your cont act s via t he Share but t on; aft er t hey've clicked on t he link in t he invit at ion em ail t hat t hey received, you can swit ch t o t he Discuss t ab on t op t o chat wit h t hem , as shown in Figure 1- 10. Also, t he cell your collaborat or is working on at t he m om ent is highlight ed in a different color. I t 's alm ost as if your spreadsheet t urned int o a wiki—t hough even wikis ( like t he online encyclopedia Wikipedia.org) usually don't show t his m uch real- t im e inform at ion regarding what ot hers are doing! For anot her Google t ool support ing real- t im e group collaborat ion, give Google Not ebook [ Hack # 14] a t ry. Pr e se n t in g t o a Gr ou p Google Present at ions has a chat feat ure sim ilar t o t he one t hat Spreadsheet s offers. Plus, wit h Present at ions you can t ake cont rol of t he docum ent and m ove from one slide t o t he next , so people can follow along in t heir own browser in real- t im e.

Edit in g a n d ch a t t in g a lon gside a spr e a dsh e e t

To share a Present at ion wit h a group, first save t he file. Now click Share Publish as web page Publish docum ent . Or, if you want t o share t he docum ent wit h only a select few, pick " Share wit h ot hers" inst ead, and invit e t he ot her m em bers. I f you decide t o publish, you will end up wit h a docum ent URL like t he following: ht t p: / / docs.google.com / Present ?docid= dfx37t n_24fxbt dz&fs= t rue Going t o t his address will show t he present at ion on t he left side and a group chat on t he right . As owner of t he docum ent , you'll see a but t on labeled " Take cont rol of t he present at ion." Click it , and you can m ove t he slides for ot hers once t hey choose t o follow you, as shown in Figure 1- 11.

W a t ch in g a pr e se n t a t ion w it h in t h e br ow se r ; t h e slide t o t h e le ft , t h e ch a t t o t h e r igh t

H a ck 3 . M a k e a D e sk t op I con t o Cr e a t e a N e w D ocu m e n t You launch deskt op program s from t he deskt op. Why not launch Google program s from t he deskt op, t oo? I f you want t o open up Google Spreadsheet s t o creat e a new file, you can point your browser t o ht t p: / / www.google.com and choose " Docum ent s" from t he " m ore" m enu on t op, t hen click New Spreadsheet . A quicker way t o do t his is t o use a bookm ark, but Mot t i St rom , Mobile Soft ware Engineer at Google UK, suggest s an even bet t er way: creat e a deskt op icon t o launch Google docum ent s, spreadsheet s, or present at ions. W indow s St art by right - clicking any free spot on your Windows deskt op and select ing New m enu, as shown in Figure 1- 12. Type t he following address for t he short cut :

Short cut from t he cont ext

ht t p: / / spreadsheet s.google.com / ccc?new Save your short cut , and nam e it " New Google Spreadsheet ."

Cr e a t in g a n e w de sk t op sh or t cu t

M a c OS X Add Bookm ark) for what ever Whet her or not you use Safari, open it up. Creat e a new bookm ark ( Bookm arks page opens up; it doesn't m at t er because you're going t o change it in a m om ent . Give t he bookm ark t he nam e " New Google Spreadsheet ." Next , select Bookm arks Show All Bookm arks, and edit t he bookm ark you j ust creat ed t o replace t he URL wit h ht t p: / / spreadsheet s.google.com / ccc?new . Now, drag t his bookm ark t o your deskt op. I f you don't want t o keep t he bookm ark in Safari, you can delet e it now, because you have a copy on t he deskt op. Tr y I t This short cut will let Google launch a new unnam ed Spreadsheet for you. Give t he icon a t ry by double- clicking it . Not e t hat you m ay be required t o log in t o your Google account if you aren't already. You can creat e a second deskt op short cut for Google Docum ent s. Use t he sam e m et hod, but pick t he following URL for t he short cut : ht t p: / / docs.google.com / ?act ion= newdoc

Save t he short cut , nam e it " New Google Docum ent ," and give it anot her t ry. For a Google Present at ions short cut , use t he following URL, nam ing it " New Google Present at ion" : ht t p: / / docs.google.com / ?act ion= new_present at ion Ch a n gin g t h e I con s You can im prove on t his hack by using nicer icons t han t he default . Ent er t he following URL in your browser's address bar t o access t he Google Spreadsheet s icon: ht t p: / / www.google.com / im ages/ spreadsheet s/ favicon.ico This is a so- called " favicon," a 16 x 16 pixel im age t hat t he browser displays in bookm arks or t he address bar when you visit a web sit e. But because it 's an .ico—icon—file t ype, you can reuse it as an icon for your short cut . I f your web browser didn't aut om at ically download it for you, right - click t he im age t o download it t o your com put er. Once you have downloaded t he icon, renam e it spreadsheet s.ico. Repeat t he sam e process wit h t he Docum ent s and Present at ions icons at t he following t wo addresses, and give it t he nam e docum ent s.ico and present at ions.ico: ht t p: / / docs.google.com / favicon.ico ht t p: / / docs.google.com / present ly/ im ages/ favicon.ico Now go back t o t he t hree deskt op short cut s t hat you creat ed t o add t hese icons. On Windows, right - click your " New Google Spreadsheet " short cut , select Propert ies from t he cont ext m enu t hat appears, swit ch t o t he Web Docum ent t ab and click t he " Change I con" but t on. Browse t o find your icon nam ed spreadsheet s.ico and click OK t o use it . On Mac OS X, download t he program im g2icns from ht t p: / / www.shinyfrog.net / en/ soft ware/ im g2icns/ and drag t he .ico file ont o it t o creat e a proper Mac OS X icon file. Swit ch t o t he Finder, click t o highlight t he icon file t hat im g2icns creat ed ( im g2icns put s files on t he Deskt op by default ) , and select Edit Copy. Right - click on your " New Google Spreadsheet " short cut , and choose Get I nfo. Click t he icon in t he upper left , and press Com m andV t o past e t he icon in. Aft er you've done t his, you can delet e t he .ico file and t he icon you creat ed, if you want t o. Voila! You can do t he sam e for your " New Google Docum ent " and " New Google Present at ion" icons by using t he docum ent s.ico and present at ion.ico files inst ead of t he one for spreadsheet s. You will now have icons based on t he Google Docs graphics, as shown in Figure 1- 13.

Th e sh or t cu t s a ppe a r in t h e officia l Google D ocs de sign n ow

Addin g a Ke yboa r d Sh or t cu t

On Windows, you can at t ach a cust om keyboard short cut t o deskt op short cut s. To do so, j ust right - click your short cut nam ed " New Google Spreadsheet " and click int o t he Short cut key field. Ent er Ct rl- Alt - S—or anot her short cut , t hough som e short cut s are reserved by Windows and cannot be chosen—and approve t he dialog. Now, you can press Ct rl- Alt - D anywhere in Windows t o launch a new spreadsheet wit h Google. You can repeat t he sam e process for your " New Google Docum ent " and " New Google Present at ion" short cut s. Pick Ct rl- Alt - D, or Ct rl- Alt - P, or any ot her keyboard short cut you can easily rem em ber, and you will now be able t o quickly launch Google Docs word processing and present at ion docum ent s from Windows. Cr e a t e a Sh or t cu t I con for a n Ex ist in g D ocu m e n t You can also creat e a short cut t o any exist ing Google docum ent of yours. Maybe t here's a shared To Do list for your proj ect at work, and you access it quit e regularly; speeding up t he launch process would be nice. First , open up your docum ent in t he browser as usual by going t o ht t p: / / docs.google.com and clicking it s t it le. Most browsers will now display t he " favicon" icon at t he left side of t he address bar. Drag and drop t his favicon ont o your deskt op, and t he short cut will be creat ed for you aut om at ically. You can close t he docum ent now and double- click t he icon lat er on t o launch it again. ( Be aware t hat if you already have t he docum ent opened in your browser, clicking t his short cut will creat e a second window wit h your docum ent .)

N OTE For furt her ways t o int egrat e Google web apps int o t he deskt op, t ake a look at t he Mozilla Prism proj ect at ht t p: / / labs.m ozilla.com / feat ured- proj ect s/ # prism .

H a ck 4 . Em be d a D yn a m ic Ch a r t in t o a Google D ocu m e n t or a W e b Pa ge Copy t he URL of a Google Spreadsheet s chart int o your docum ent —or a web page—and configure it so t hat it aut om at ically updat es whenever you change t he underlying dat a. Debora runs an ice cream shop in London. London is not t he warm est locat ion in t he world, which m ight hurt her sales, but Debora knows one way t o get t he word out t o m ake m ore people com e t o her shop: an am azingly cool web sit e. For her sit e, she prepares hist orical art icles on t he subj ect of ice cream , and also want s t o include a near real- t im e chart of t he m ost popular flavors she's selling t hat week. Debora can creat e t he flavor sales chart in Google Spreadsheet s, but how can she include t his chart in a Google Docs docum ent so t hat it 's aut om at ically updat ed? St art by creat ing a new spreadsheet [ Hack # 1] . Fill t he left colum n wit h flavors and t he right colum n wit h sales num bers. You can t hen include a chart by select ing all filled cells and clicking t he chart icon on t op. I n t he " Creat e chart " dialog t hat appears, pick your preferred design ( such as a a t hree- dim ensional pie chart ) and click " Save chart ." Your spreadsheet will now look sim ilar t o t he one pict ured in Figure 1- 14. Next , right - click t he chart and choose " Publish chart " from t he m enu t hat appears. A window will appear wit h t he code you need t o em bed t his chart in an HTML page. Highlight t his code and copy it . You can now insert t his Edit HTML and im age in a Google Docs docum ent . I nst ead of using t he I nsert Pict ure m enu, swit ch t o Edit past e t he code int o a paragraph, as in t he following code sam ple:

A spr e a dsh e e t list in g ice cr e a m sa le s, w it h a 3 D pie ch a r t

Code View:





N OTE I n preceding exam ple, t here is an addit ional st yle definit ion [ Hack # 18] t o posit ion t he im age t o t he right of t he t ext . The m argin values are provided in t he clockwise order of t op, right , bot t om , left . I f you swit ch t o t he norm al edit ing m ode and t hen back t o Edit HTML m ode, you'll not ice t hat Google has ent it y- escaped t he URL for you ( changing & t o &) . This is not hing t o worry about , and in fact it will m ake sure your docum ent is valid HTML.

Not e t his m et hod of em bedding t he chart also works wit h any ot her webpage, such as a blog post . " Publish as web page" ; select " Aut om at ically To publish t he Google docum ent as a web page, choose Share re- publish . . ." here t oo, if you want t o ensure t hat all your fut ure edit s will be reflect ed in t he docum ent . Not e t hat you should not pick t he aut om at ic republishing opt ion if you don't want people t o see your changes in real " Publish as web page" , and t hen click t im e. I nst ead, wait unt il you're done wit h your revisions, click Share " Re- publish docum ent ." To everyone except t hose wit h edit ing right s for your docum ent , t he result will look as pict ured in Figure 1- 15. ( I f edit ing right s are available, t he docum ent will appear inside a Google Docs edit or.) And now, whenever you change any of t he underlying flavor sales dat a in t he original spreadsheet , t his web page will aut om at ically display t he lat est version of t he pie chart , as shown in Figure 1- 16—t here's a slight loss on t he vanilla front , but Debora has t his well covered wit h increased chocolat e sales! Th e Google Ch a r t s I m a ge Ge n e r a t or Anot her way t o em bed chart s int o a web page or a Google Docs docum ent is t o use t he Google Chart s API , a st andalone service not connect ed t o Google Spreadsheet s. " API " is short for Applicat ion Program m ing I nt erface, but t here's usually no program m ing needed t o get t he Google Chart s API t o work—it 's j ust a st raight forward way of creat ing a special im age URL, which you t hen include in your page.

Th e or igin a l ch a r t , pu blish e d in a Google D ocs docu m e n t e x por t e d a s a w e b pa ge

Th e ch a r t on t h e docu m e n t a u t om a t ica lly u pda t e d a ft e r ch a n gin g t h e u n de r lyin g spr e a dsh e e t n u m be r s

Here's an exam ple chart URL, which generat es t he 3D pie chart shown in Figure 1- 17 as a PNG file; anot her t ype of chart im age is shown in Figure 1- 18: ht t p: / / chart .apis.google.com / chart ?cht = p3&chd= t : 90,49&chs= 350x150&chl= Foo| Bar Give t his a t ry by ent ering t he URL int o t he browser address bar. Now, if you break down t he URL int o it s param et er com ponent s, you will bet t er underst and how it works: ch t = p3 t ells t he im age t hat t he chart t ype want ed is a pie chart in 3D ( " p3" ) . ch d= t :9 0 ,4 9 are t he act ual chart values, separat ed by a com m a, in t ext form at ( t he " t " ) . ch s= 3 5 0 x 1 5 0 defines t he resolut ion of your chart ; in t his case, a widt h of 350 pixels and a height of 150 pixels. ch l= Foo| Ba r indicat es t he t ext t hat labels each sect ion of t he pie chart .

Not e t hat t he Chart API is lim it ed t o 50,000 request s per day—if you expect t o generat e m ore request s t han t hat , you m ay want t o cache t he im age on your server inst ead of issuing a request each t im e som eone visit s your page.

Th e im a ge ge n e r a t e d by t h e Google Ch a r t s API

An ot h e r im a ge fr om t h e Google ch a r t s ge n e r a t or

The API can do m uch m ore t han t his, t hough. You can choose from m any different chart t ypes, or cust om ize colors, line st yles, and fills, t o nam e j ust a few of t he available opt ions. For a full list of feat ures, t ake a look at Google's docum ent at ion available at ht t p: / / code.google.com / apis/ chart / .

H a ck 5 . Sh a r e D ocu m e n t s w it h a Gr ou p I f you find yourself sharing m any docum ent s wit h t he sam e group of people, adding all t heir nam es each t im e can be t iresom e. The Share t ab of Google Docs has a nice feat ure t hat 's easy t o overlook: cust om invit at ion groups. I f you need t o invit e t he sam e people over and over, t his one is for you. The solut ion present ed here was originally laid out by I onut Alexandru Chit u, a Google expert and blogger (ht t p: / / googlesyst em .blogspot .com ) from Rom ania, who want ed an alt ernat ive t o an ot herwise t edious process. To give t his a t ry, creat e a new docum ent by going t o ht t p: / / docs.google.com and choosing New Docum ent ( or Spreadsheet or Present at ion) from t he m enu. Ent er som e t ext and save your docum ent . Now swit ch t o " Share wit h ot hers" . I nst ead of t yping t he nam es of t he people you want t o invit e, click t he " Choose Share from cont act s" link. Select All Cont act s from t he dropdown m enu ( it default s t o Most Cont act ed) in t he new window t hat appears, and select all t he people you want t o share t he docum ent wit h, as shown in Figure 1- 19.

N OTE Alt hough you can't direct ly edit or delet e a group wit hin Google Docs, all groups are shared wit h Gm ail—See [ Hack # 39] for m ore inform at ion. So t o edit a group, visit Gm ail at ht t p: / / gm ail.com and click t he Cont act s link t o t he left . Depending on your browser and browser set t ings, Google's prom pt s—like t he one asking you t o nam e your cont act group—m ay not im m ediat ely appear. This m ay happen, for inst ance, on Windows I nt ernet Explorer 7, where a yellow bar on t op of t he window alert s you wit h a warning, suppressing t he Google prom pt . To perm anent ly disable t his securit y warning when working wit h Google Docs in I nt ernet Explorer 7, select Tools I nt ernet Opt ions from t he m enu. Swit ch t o t he Securit y t ab and select t he Trust ed Sit es icon. Now click t he " Sit es" but t on and add "ht t p: / / docs.google.com " t o t he list of web sit es ( uncheck t he " Requires server verificat ion" box if necessary) .

Th e Google D ocs con t a ct s dia log

I nst ead of clicking Done right away in t his dialog, click t he " Save as Group" but t on. A new prom pt asks you t o nam e t his group, so provide a nam e like Colleagues or Fam ily. Now when you close t he dialog via t he Done but t on, t he nam es you select ed will be ent ered int o t he invit at ion box for you. But t he next t im e you want t o share a docum ent , you can j ust click t he " Choose from cont act s" link, select your cust om group from t he dropdown m enu at t he t op of t he window ( t he sam e m enu t hat default s t o Most Cont act ed) , and press t he " Add All" but t on t o invit e all of t hem at once.

H a ck 6 . Au t om a t ica lly Ope n Loca l File s w it h Google Wouldn't it be neat t o aut om at ically open a local Office file wit h Google Spreadsheet s? Act ually, you can! By default , t hose files you open in t he Google Docs file list ing at ht t p: / / docs.google.com will open in Google's edit or. Local files on your hard disk, however, are likely t o be associat ed wit h an offline program like OpenOffice.org or Microsoft Office. But t here's a way t o associat e t hese files wit h Google's t ools. All you need is t he Google Toolbar for your browser. For t his hack, you need Firefox 1.5+ . I f you don't have t he Firefox browser yet , you can get it for free at ht t p: / / firefox.com . Then point your browser t o ht t p: / / t oolbar.google.com and click t he " Download Google Toolbar" but t on t o get t he Google t oolbar, as pict ured in Figure 1- 20. During inst allat ion, you need t o approve several confirm at ion dialogs, and finally rest art your browser. Once t he set up is com plet e, you will not ice t he t oolbar at t he t op of your browser. Select Set t ings Opt ions from t he t oolbar m enu t o t he right , as pict ured in Figure 1- 21. I n t he dialog t hat opens, select t he Docs checkbox, and click t he " File Set t ings . . ." but t on below it ; now check t he " Double- click a file icon" opt ion and confirm t he dialogs by clicking OK, as shown in Figure 1- 22.

Th e Google Toolba r h om e pa ge

Acce ssin g t h e Google Toolba r 's opt ion s

Th e D ocs

File Se t t in gs dia log of t h e Google Toolba r

N OTE At t he t im e of t his writ ing, t he " Double- click a file icon" opt ion was not available on Mac OS X or Linux.

Now, files wit h ext ensions like RTF, ODS, or XLS—Microsoft Office or OpenOffice file t ypes—will aut om at ically open wit h Google. Give it a t ry by locat ing an XLS file on your com put er, or creat e a new one. The first t hing you will not ice is t hat t he icon has changed. Double- click t he file ( or drag it int o Firefox) , and you will see it open in your browser, as shown in Figure 1- 23. Also, t he file will be aut om at ically added t o your Google Docs file list ing.

Ope n in g a M icr osoft Ex ce l file fr om you r de sk t op w it h t h e Google Spr e a dsh e e t s e dit or

Not e t hat what you opened now in t he browser is a redundant Google Docs copy of t he docum ent ; changes you are m aking here will not be saved back t o t he docum ent on your hard drive, unless you decide t o export t he docum ent again t o overwrit e t he old, local version. I n ot her words, while you did open t he local file ( i.e., you uploaded and saved it t o Google Docs and loaded it in t he edit or) , all edit ing and saving will happen t o t he new online file.

Not all of your original files m ay survive t he t ransit ion t o Google Docs. For inst ance, a chart graphic included in an Excel file m ay not show any m ore once t he file is opened in Google Spreadsheet s.

H a ck 7 . Google D ocs on t h e Ru n I f you carry a m obile phone wit h a web browser, t hen you carry part s of Google Office, t oo—wit hout having t o inst all anyt hing. When you're on t he go, viewing your Google Docs docum ent s works best on a lapt op, ult ram obile PC, or web t ablet . However, in som e circum st ances you m ight want t o have a quick look at one of your docum ent s wit hout bust ing out any of t hese devices. I n t hose sit uat ions t here's a fallback plan wait ing for you at ht t p: / / docs.google.com / m : Google Docs m obile. The m obile variant of Google Docs, a light 'n' lean version of t he Docs web sit e opt im ized for cellphones, as pict ured in Figure 1- 24, let s you view your file list ings as well as som e of t he file cont ent s. Exact ly what you will see depends on your t ype of m obile phone, but in general, if your phone support s rich browsing, you can:

View a list of all of your files

Search for specific files

Open Docs folders

Open spreadsheet s in HTML view

Open spreadsheet s as Excel files ( if your phone support s t he XLS Excel spreadsheet form at )

Open word processing docum ent s

N OTE When you open Google Docs m obile on your cellphone, you will be required t o log in if you're not aut hent icat ed. To save som e t im e writ ing your full usernam e, you can—as is t he case wit h t he deskt op version of Google Docs—ent er " officehacks" inst ead of t he full "officehacks@gm ail.com " ( for exam ple) . This t rick works only wit h Gm ail addresses, t hough.

Opening a word processing docum ent in Google Docs m obile will j ust show t he file as it would appear on a web sit e. ( Present at ion files cannot be opened on anyt hing but iPhones at t he t im e of t his writ ing.) The rendering for spreadsheet s, on t he ot her hand, is a lit t le m ore advanced in it s opt im izat ion for sm all screens. You will by default see only a single colum n, and you can j um p t o specific rows or colum ns. You can also view t he cont ent s of a single cell on it s own by ent ering it s coordinat es in t he colum n/ row search box, as shown in Figure 1- 25, and t hen select ing t he " Go t o Cell" but t on.

Th e Google D ocs m obile h om e pa ge

Vie w in g a n ice cr e a m sa le s spr e a dsh e e t

H a ck 8 . Ba ck Up All You r Google D ocs File s Make your backups before som et hing bad happens, not aft erwards. Google no doubt backs up your Google Docs dat a on som e of t heir m any servers. And old versions of your docum ent st ill live on t hrough t heir revision hist ory. But when you delet e a docum ent , t here's no get t ing it back. You can m inim ize t he dam age of such accident s by st oring copies of Google Docs docum ent s on your hard disk ( from which you can burn t hem on CD, copy t hem t o your USB st ick, upload t hem t o ot her st orage services or your own server, and so on) . Ba ck in g Up a Sm a ll N u m be r of File s I f you have only a couple of word processing docum ent s or present at ions t o back up, here's what you can do. Log in t o Google Docs and in t he file list ing pane, select all of your files of a single t ype—only docum ent s, or only present at ions—one by one. Then open t he " More act ions" m enu on t op and pick " Save as HTML ( zipped) ." You can now select a folder on your hard drive and let t he download begin. However, t his m et hod is very lim it ed, at least at t he t im e of t his writ ing. For one t hing, Google Docs won't let you select different file t ypes for download ( like a m ixt ure of word processing docum ent s and present at ions) . Also, downloading won't work if you select m ore t han a single spreadsheet at once. Ba ck in g Up All You r File s But t here's an alt ernat ive, robust approach t o backing up all docum ent s. The det ailed st eps are as follows. For t his t o work, you need t he Firefox browser, t he Greasem onkey ext ension, t he DownThem All Greasem onkey script , and t he GoogleDocsDownload Greasem onkey script . This solut ion was originally described by I onut Alexandru Chit u in his blog Google Operat ing Syst em at ht t p: / / googlesyst em .blogspot .com . Here are t he st eps in det ail—not e t hat whenever you are asked t o rest art your browser aft er inst allat ions, you m ust do so before cont inuing:

1 . I nst all Greasem onkey by clicking t he I nst all Now but t on at ht t ps: / / addons.m ozilla.org/ enUS/ firefox/ addon/ 748. ( Rest art your browser aft er t he inst allat ion, and you will see a sm iling m onkey head icon in t he bot t om right of your browser.)

2 . I nst all DownThem All by clicking t he I nst all but t on at ht t p: / / downt hem all.net and following t he inst ruct ions. DownThem All is a t ool t hat allows you t o download m ult iple files cont ained in a web page at once.

3 . I nst all GoogleDocsDownload by t yping ht t p: / / 1st - soft .net / gdd/ googledocdownload.user.j s in your address bar and pressing Ret urn or Ent er. Follow t he inst ruct ions t hat appear.

You now have all t he t ools t o st art t he act ual backup process, which you can repeat anyt im e you want t o creat e a backup:

1 . Log in t o ht t p: / / docs.google.com .

2.

2 . Select all docum ent s. This is t rickier t han it m ay seem , because if you have m ore t han 50 docum ent s, you first need t o repeat edly scroll down t he file list ing pane, t hen wait a bit , t hen scroll down again, in order t o m ake Google show all files. Aft erwards, next t o t he " Select " label, click t he link reading " All X" files ( where X is t he num ber of your files) .

3 . I n t he t op right , you will not ice a m enu ent ry reading Download Select ed Docum ent s. ( This link appears t hanks t o t he GoogleDocsDownload script you previously inst alled.) Open t his m enu and choose Microsoft Office Files, as shown in Figure 1- 26.

All docu m e n t s a r e se le ct e d, so it 's t im e t o click " D ow n loa d Se le ct e d D ocu m e n t s"

Ope n in g D ow n Th e m All t o dow n loa d a list of lin k s a ll a t on ce

4 . A new browser window opens cont aining links t o all of your Google Docs files. Downloading t hem individually is t edious, but t hanks t o DownThem All, you can now right - click t he page t o select " DownThem All! . . ." from t he cont ext m enu, as shown in Figure 1- 27.

5.

5 . I n t he DownThem All dialog t hat pops up, as shown in Figure 1- 28, check t he " All files" box, and t hen specify a place t o download t o by clicking t he folder icon. Hit t he St art but t on t o begin downloading. Wait for t he download t o finish and you're done!

You now have all your docum ent s in different form at s on your hard disk. Spreadsheet s are available as XLS files, and can be opened wit h program s like Microsoft Excel, OpenOffice Calc or, again, Google Spreadsheet s [ Hack # 6] . Word processing docum ent s get t he .doc ext ension. And present at ions are available as a ZI P file t hat cont ains t he needed HTML, st ylesheet , and im age resources.

N OTE I f you don't m ind fiddling around at t he com m and prom pt , t here's an advanced m et hod for backing up files using a Pyt hon script . Take a look at GDat aCopier at ht t p: / / code.google.com / p/ gdat acopier/ .

Con figu r in g D ow n Th e m All t o st a r t t h e dow n loa d of a ll file s

H a ck 9 . Be yon d Google : Cr e a t e D ocu m e n t s w it h Zoh o, Edit Gr id a n d m or e I f you're not com plet ely sat isfied wit h t he Google Docs product fam ily, or you j ust want t o explore ot her offerings t o find alt ernat ive feat ures, t ake a look at Zoho, Edit Grid, and ot hers. Zoh o: On lin e Office Su it e Zoho, sim ilar t o Google Docs, is a free online office applicat ion suit e. I t com es com plet e wit h a rich t ext edit or ( Zoho Writ er) , a spreadsheet edit or ( Zoho Sheet ) , a present at ion edit or ( Zoho Show) , and m ore. You can regist er for an account at ht t p: / / zoho.com , shown in Figure 1- 29. Aft er signing up, you'll get an em ail wit h a confirm at ion link. Click t he link, and you are ready t o creat e your first docum ent . I n Figure 1- 30, you can see a spreadsheet list ing people's ages and occupat ions. The average age was calculat ed using t he AVERAGE form ula. The chart graphic was insert ed using t he Add Chart t oolbar icon, t hen choosing t he St acked Colum n 3D t ype. As wit h Google Docs, aft er preparing your docum ent , you can share it wit h a select ed group of people, or publish it as a web page for all t o see. Wit h Zoho Writ er, you can creat e word processing docum ent s, as shown in Figure 1- 31. You can st yle your docum ent in a variet y of ways, include im ages or sm ileys, run a spellchecker, or graphically creat e t ables, t o nam e j ust a few of t he opt ions. A t oggle HTML source t oolbar icon ( labeled as " < > " ) allows you t o edit t he source of t he docum ent . You can t hen publish t he finished docum ent as a web page or em bed it in your blog. Edit Gr id: An Alt e r n a t ive t o Google Spr e a dsh e e t s, Ex ce l, or Ope n Office .or g Edit Grid, available at ht t p: / / edit grid.com and shown in Figure 1- 32, also allows you t o creat e spreadsheet s online. I t is available as a free version as well as a m ore powerful " Organisat ion Account ." Using Edit Grid, you are able t o creat e spreadsheet s wit h 516 different form ulas ( t hat 's about as m any as Google Spreadsheet s) , and t hen collaborat e on your dat a wit h ot hers. Chart graphics are support ed as well, as pict ured in Figure 1- 33. Also, Edit Grid support s an API ( Applicat ion Program m ing I nt erface) for developers t o connect dat a t o t heir own applicat ions, sim ilar t o what Google does wit h t heir Google Spreadsheet s Dat a API .

Zoho.com , a n on lin e a lt e r n a t ive t o t h e Google office su it e

Th e Zoh o Sh e e t e dit or , w it h a list of you r docu m e n t s t o t h e le ft

On t op of all t hat , you can include dat a from ot her sources by launching t he Rem ot e Dat a wizard by select ing Manage Rem ot e Dat a. You can pick from any of t he t hree cat egories: St ock Quot e, Currency Exchange, Dat a and Web Dat a. Edit Grid's Web Dat a feat ure is part icularly int erest ing, as it allows you t o grab dat a from any public webpage. At ht t p: / / edit grid.com / t nc/ cliff/ Pressure_Tracker , t he Edit Grid t eam post ed an exam ple of t his funct ionalit y. The goal of t he spreadsheet sam ple is t o get t he pressure value from a Hong Kong weat her web page. Aft er opening t he HTML source code of t he weat her web page, you will see t he relevant part t hat print s t he pressure value, which goes som et hing like t his:

Cr e a t in g a docu m e n t w it h t h e Zoh o W r it e r e dit or

Th e Edit Gr id h om e pa ge

... Pressure:

29.68 in.

...

But all you need is t he highlight ed value " 29.68" . At t his point , you can use t he following regular expression [ Hack # 13] : (?!nbsp:)Pressure:.*

Th e Edit Gr id m a in e dit or vie w

Not e t hat t his act of so- called " screenscraping" as used by t he Web Dat a feat ure is som ewhat error- prone, as your regular expression m ay becom e invalid whenever t he sit e you're scraping updat es t heir HTML t em plat e. Addit ionally, it m ay be against a sit e's Term s of Service or robot s.t xt declarat ion file t o use aut om at ed screenscraping m echanism s. I f t he web sit e has an official API , you should use t hat and becom e fam iliar wit h it s Term s of Service. This is not t o say t hat using an API is com plet ely m aint enance- free ( API s som et im es get discont inued, or change t heir prot ocol in such a way t hat you'll need t o rewrit e your applicat ions) .

This expression ret rieves a m uch sm aller port ion of t he full HTML page. You can now use Edit Grid's RI GHT funct ion t o get j ust t he num ber in quest ion and have it display in anot her spreadsheet cell of yours, as shown in Figure 1- 34.

Acce ssin g live da t a fr om w e b sit e s u sin g Edit Gr id's W e b D a t a fe a t u r e

Th in k Fr e e 's On lin e Office Su it e ThinkFree ( ht t p: / / www.t hinkfree.com ) is anot her online applicat ion provider, offering free online word processing, spreadsheet , and present at ion edit ors. ThinkFree's program s com e in t wo flavors each: Quick Edit and Power Edit . The quick edit ing lacks som e feat ures t hat com pet it or's t ools m ay have, but t he power edit ing is a m ore com plet e applicat ion, and it looks a lot like Microsoft 's Office suit e. Not e t hat t he Power Edit m ode needs t o inst all a set of Java files on your m achine before you edit t he first t im e. As you can see pict ured in Figure 1- 35 ( a word processing docum ent in Quick Edit m ode) and Figure 1- 36 ( a spreadsheet in Power Edit m ode) , bot h program variant s show advert isem ent s on t he right hand side of your docum ent .

Th e Th in k Fr e e w or d pr oce ssin g e dit or : Qu ick Edit m ode

Edit in g a spr e a dsh e e t w it h Th in k Fr e e : Pow e r Edit m ode

TH E GOOGLE D OCS FAM I LY: GOOGLE D OCUM EN TS W r it in g on pa pe r —lik e t h e k in d m a de fr om t h e pa pyr u s pla n t a n d u se d in a n cie n t Egypt , or t h e k in d you 'd bu y in a st or e t oda y—m a y se e m old- fa sh ion e d, bu t com pa r e it t o you r t ypica l digit a l w or d pr oce ssor t oda y ( lik e M icr osoft W or d, or Ope n Office .or g W r it e r ) ... On paper, you can use any t ype of sym bol, wit hout having t o worry about inst alling font s. You can easily include your drawings wit hout increasing t he file size. You can get t oget her wit h a sm all group t o scribble along on t he sam e paper in real t im e. You can underline, st riket hrough, and use arrows and quick chart s wit hout knowing a single short cut or locat ion of a m enu ent ry. Also, paper won't ask you t o regist er before using it . What does Google docum ent s ( see Chapt er 1 for an overview and int roduct ion) have t hat paper doesn't , anyway? Besides not requiring t rees t o be felled in product ion, t hat is. Here's an overview:

Wit h Google docum ent s, you can view t he edit ing hist ory of a file. This m eans t hat if you want t o, you can com pare t he current st at e of t he docum ent wit h one from t wo m ont hs ago, and replace t he new version wit h t he old version if necessary.

Wit h Google docum ent s, you can collaborat e in real t im e wit h a group of people who are not in t he sam e room , or even in t he sam e count ry.

You can check t he spelling of t he docum ent , get a count of all t he words in t he docum ent , or search and replace wit hin t he t ext .

Google docum ent s allows you t o let som eone else see your file wit hout you having t o m ake a copy of it —t hey will sim ply be referred t o your source docum ent , provided you grant t hem access t o it .

Now, papyrus paper would last about 200 years in European condit ions. I t 's hard t o t ell how long your Google docum ent s writ ings will last . Writ ely, t he predecessor t o Google docum ent s ( before Google acquired Upst art le, t he creat ors of Writ ely) , has only been around for t wo years. But if you're suspicious about t he longevit y of t his m edium , t here's st ill t he opt ion t o print out any Google docum ent .

H a ck 1 0 . Le t Ot h e r s Su bscr ibe t o You r D ocu m e n t Ch a n ge s Using Google Docs' RSS feed of docum ent changes, you can let ot hers keep up wit h t he revisions you m ake t o a public docum ent . All t hey need is a feed reader applicat ion or web browser. Say you're using Google Docs t o writ e a proj ect t o- do list [ Hack # 68] for a group. There are t wo it em s on t he list already, as shown in Figure 2- 1: 1. Have som eone get t he m ilk, and 2. Unscrew t he light bulb . You now want t o add a t hird it em . Docs already allows you t o let ot hers see your docum ent , or edit along if you like. But how do t hey know when you've changed t he docum ent ?

A pr oj e ct t o- do list for you r t e a m

One way t o keep everyone up t o dat e is t o publish your docum ent changes via an RSS feed. An RSS feed is a web- based subscript ion form at t hat allows t he browser or a separat e client program ( t he RSS reader) t o display frequent ly updat ed cont ent , like a blog, a news sit e—or your Google docum ent 's change log. Be for e you ca n pu blish t h e RSS fe e d, you r docu m e n t m u st be pu blish e d. Publishing a docum ent doesn't t hat m ean you m ake it fully public; only t hose who know t he docum ent address will be able t o access it , and t his address won't aut om at ically be list ed in search result s ( and t he address is not easy t o guess eit her) . " Publish as web page" and click t he " Publish docum ent " but t on. To m ake your docum ent public, hit Share You should also act ivat e t he " Aut om at ically re- publish when changes are m ade" checkbox.

Anyone you send t he docum ent URL t o can also pass it on for ot hers t o see ( and if som eone post s it on a discussion board, it m ight even st art appearing in search result s) . Public docum ent s aren't password- prot ect ed—use Share " Share wit h ot hers" t o share confident ial docs wit h only t he users you specify.

Not e t hat you can st op publishing lat er at any t im e. " Share wit h ot hers" and t he link st art ing wit h Now you need t o find t he RSS feed's address. Click Share " View RSS" , as pict ured in Figure 2- 2. A new window opens, from which you can bookm ark or copy t he URL. Send t he URL t o your collaborat ors and let t hem subscribe t o it . Your collaborat ors can subscribe via t heir browser's nat ive feed reader opt ion, or you can point t hem t o a st andalone RSS reader like Google Reader ( see Chapt er 8 ) at ht t p: / / reader.google.com , as shown in Figure 2- 3—and you're done. You can now add a t hird it em t o your list ( for exam ple, 3. Get help in case unscrewing of t he light bulb goes wrong) , and ot hers will be

alert ed of your changes when t hey check t heir RSS reader. Your t eam can also set up a program like rss2em ail at ht t p: / / rss2em ail.infogam i.com t o aut om at ically get an em ail whenever t he RSS feed changes.

Th e Sh a r e m ode , in clu din g t h e " Vie w RSS fe e d . . . " lin k

Google Re a de r , n ow su bscr ibe d t o t h e t o- do list 's ch a n ge h ist or y

TH E GOOGLE D OCS FAM I LY: GOOGLE D OCUM EN TS W r it in g on pa pe r —lik e t h e k in d m a de fr om t h e pa pyr u s pla n t a n d u se d in a n cie n t Egypt , or t h e k in d you 'd bu y in a st or e t oda y—m a y se e m old- fa sh ion e d, bu t com pa r e it t o you r t ypica l digit a l w or d pr oce ssor t oda y ( lik e M icr osoft W or d, or Ope n Office .or g W r it e r ) ... On paper, you can use any t ype of sym bol, wit hout having t o worry about inst alling font s. You can easily include your drawings wit hout increasing t he file size. You can get t oget her wit h a sm all group t o scribble along on t he sam e paper in real t im e. You can underline, st riket hrough, and use arrows and quick chart s wit hout knowing a single short cut or locat ion of a m enu ent ry. Also, paper won't ask you t o regist er before using it . What does Google docum ent s ( see Chapt er 1 for an overview and int roduct ion) have t hat paper doesn't , anyway? Besides not requiring t rees t o be felled in product ion, t hat is. Here's an overview:

Wit h Google docum ent s, you can view t he edit ing hist ory of a file. This m eans t hat if you want t o, you can com pare t he current st at e of t he docum ent wit h one from t wo m ont hs ago, and replace t he new version wit h t he old version if necessary.

Wit h Google docum ent s, you can collaborat e in real t im e wit h a group of people who are not in t he sam e room , or even in t he sam e count ry.

You can check t he spelling of t he docum ent , get a count of all t he words in t he docum ent , or search and replace wit hin t he t ext .

Google docum ent s allows you t o let som eone else see your file wit hout you having t o m ake a copy of it —t hey will sim ply be referred t o your source docum ent , provided you grant t hem access t o it .

Now, papyrus paper would last about 200 years in European condit ions. I t 's hard t o t ell how long your Google docum ent s writ ings will last . Writ ely, t he predecessor t o Google docum ent s ( before Google acquired Upst art le, t he creat ors of Writ ely) , has only been around for t wo years. But if you're suspicious about t he longevit y of t his m edium , t here's st ill t he opt ion t o print out any Google docum ent .

H a ck 1 0 . Le t Ot h e r s Su bscr ibe t o You r D ocu m e n t Ch a n ge s Using Google Docs' RSS feed of docum ent changes, you can let ot hers keep up wit h t he revisions you m ake t o a public docum ent . All t hey need is a feed reader applicat ion or web browser. Say you're using Google Docs t o writ e a proj ect t o- do list [ Hack # 68] for a group. There are t wo it em s on t he list already, as shown in Figure 2- 1: 1. Have som eone get t he m ilk, and 2. Unscrew t he light bulb . You now want t o add a t hird it em . Docs already allows you t o let ot hers see your docum ent , or edit along if you like. But how do t hey know when you've changed t he docum ent ?

A pr oj e ct t o- do list for you r t e a m

One way t o keep everyone up t o dat e is t o publish your docum ent changes via an RSS feed. An RSS feed is a web- based subscript ion form at t hat allows t he browser or a separat e client program ( t he RSS reader) t o display frequent ly updat ed cont ent , like a blog, a news sit e—or your Google docum ent 's change log. Be for e you ca n pu blish t h e RSS fe e d, you r docu m e n t m u st be pu blish e d. Publishing a docum ent doesn't t hat m ean you m ake it fully public; only t hose who know t he docum ent address will be able t o access it , and t his address won't aut om at ically be list ed in search result s ( and t he address is not easy t o guess eit her) . " Publish as web page" and click t he " Publish docum ent " but t on. To m ake your docum ent public, hit Share You should also act ivat e t he " Aut om at ically re- publish when changes are m ade" checkbox.

Anyone you send t he docum ent URL t o can also pass it on for ot hers t o see ( and if som eone post s it on a discussion board, it m ight even st art appearing in search result s) . Public docum ent s aren't password- prot ect ed—use Share " Share wit h ot hers" t o share confident ial docs wit h only t he users you specify.

Not e t hat you can st op publishing lat er at any t im e. " Share wit h ot hers" and t he link st art ing wit h Now you need t o find t he RSS feed's address. Click Share " View RSS" , as pict ured in Figure 2- 2. A new window opens, from which you can bookm ark or copy t he URL. Send t he URL t o your collaborat ors and let t hem subscribe t o it . Your collaborat ors can subscribe via t heir browser's nat ive feed reader opt ion, or you can point t hem t o a st andalone RSS reader like Google Reader ( see Chapt er 8 ) at ht t p: / / reader.google.com , as shown in Figure 2- 3—and you're done. You can now add a t hird it em t o your list ( for exam ple, 3. Get help in case unscrewing of t he light bulb goes wrong) , and ot hers will be

alert ed of your changes when t hey check t heir RSS reader. Your t eam can also set up a program like rss2em ail at ht t p: / / rss2em ail.infogam i.com t o aut om at ically get an em ail whenever t he RSS feed changes.

Th e Sh a r e m ode , in clu din g t h e " Vie w RSS fe e d . . . " lin k

Google Re a de r , n ow su bscr ibe d t o t h e t o- do list 's ch a n ge h ist or y

H a ck 1 1 . Blog w it h Google D ocs Wit h t he help of Google Docs' publishing opt ions, you can use t he Docs edit or t o blog. A blog helps you t o com m unicat e wit h a group of people at once ( see Chapt er 10) . I t 's your very own newspaper, or, if you prefer, your public diary. Done right , blogs ( short for " web logs" ) are m ore of a t wo- way conversat ion t han a m onologue. People can com m ent on what ever you writ e, and if you int egrat e t he com m ent s int o your exist ing and fut ure post s, t he blog becom es a form of dynam ic, collaborat ive writ ing. Blogs can also be a great way t o get your head around any subj ect ; blog about som et hing, and you m ight end up becom ing an expert in t his field. However, don't expect t o t alk wit h a large audience im m ediat ely, or t o end up as expert in a field aft er a week—bot h part s t ake t im e and dedicat ion, and even t he best blogging t ool in t he world can't aut om at e t his effort . Blogging t ools always com e wit h a built - in edit or; t hat 's how t hey m ake web publishing as easy as possible. But you can also use Google Docs as an alt ernat ive blogging edit or. Let 's creat e a Docs- powered blog. For t his exam ple, I 'll creat e a m ovie review sit e. First , you need t o sign up wit h Google's Blogger at ht t p: / / blogger.com t o creat e a blog. You can use your Google Account login for t his service, t hen choose a display nam e, and accept t he Term s of Service, as shown in Figure 2- 4. Now click t he " Creat e your Blog . . ." but t on and set up a blog wit h your preferred t it le, address, and t em plat e, as shown in Figure 2- 5.

Sign in g u p for Blogge r

Pick in g a blog t it le a n d a ddr e ss

By default , your blog will be host ed at Blogspot .com . I n t his case, t he blog is nam ed " Good and Bad Flicks" and it s address is ht t p: / / goodandbadflicks.blogspot .com . I f you prefer, you can m ake t he blog invit at ion- only, which Per m issions Blog Readers opt ions; m eans you get t o choose who can read it . To do t his, use t he Set t ings ot herwise, everyone can read your blog. Now t hat your blog is creat ed, you can go t o Google Docs at ht t p: / / docs.google.com and creat e a new docum ent as usual, including im ages, headlines, links, and m ore, as shown in Figure 2- 6. When you're done creat ing t he docum ent , click t he " blog sit e set t ings" link in t he " Publish as web page" dialog. Ent er your usernam e and ot her inform at ion exact ly like you did when you signed up wit h Blogger. Or, if you're using anot her blogging t ool like LiveJournal or WordPress [ Hack # 114 ] , use your credent ials from t hat service. Confirm by clicking OK. You can now click t he " Post t o blog" but t on and view t he result on your blog, as pict ured in Figure 2- 7!

N OTE I n case you are using your own server or dom ain for your blog, you can also select " My own server/ cust om " on t op of Google Docs' Blog Sit e Set t ings dialog, and provide your blog's API Access URL. MovableType, for inst ance, uses t he URL ht t p: / / YOURBLOG/ PATH/ TO/ m t - xm lrpc.cgi for t his. A m ore ext ensive list of Access URLs can be opened by following t he link reading " Click here for yours" in Google's dialog.

Bloggin g a m ovie r e vie w in Google D ocs

Th e r e vie w is n ow live a t t h e blog

H a ck 1 2 . I n se r t Spe cia l Ch a r a ct e r s I n t o You r D ocu m e n t s Find out about Unicode charact ers, and how you can use t hem in your Google Docs docum ent s. There are m ore let t ers around t han t he ones you see on t he keyboard. I n fact , t here are m ore keyboards around t han t he one you're used looking at . I n Germ any, for inst ance, t he t op let t ers row st art s wit h " QWERTZ" inst ead of t he English " QWERTY," and you'll find t he " um laut " charact er keys Ö, Ü, and Ä on t he right side. But when t he charact er you want isn't on your keyboard at all, you need t o look int o soft ware t o get what you need. Chinese users, for inst ance, use I MEs ( I nput Met hod Edit ors) , which allow you t o ent er basic let t ers ( Pinyin) , which are t hen " t ranslit erat ed" int o t he Chinese sym bol. Google also offers an I ME of t heir own for free download at ht t p: / / t ools.google.com / pinyin/ . On Mac OS X, when you need t o ent er a special charact er, click t he input m enu, which is a flag icon in t he m enu bar ( if it 's not visible, go t o Syst em Preferences I nt ernat ional I nput Menu and select " Show input m enu in m enu bar" ) and select Show Charact er Palet t e. You can search for charact ers using t his palet t e, and double- click on t he desired charact er t o insert it . I n Windows, you can see t his charact er t able by going t o St art Program s Accessor ies Syst em Tools Charact er Map. You can swit ch t o different groups in t his list , and copy any let t er t o t hen past e it int o your docum ent .

N OTE On Windows, you can also t ype special charact ers in Google Docs, or any ot her t ext edit or, by holding down t he Alt - key on your keyboard and pressing a num ber com binat ion on your num pad; Alt - 0169 result s in © , and Alt - 0165 result s in ¥.

To accom m odat e all t he special charact ers across languages, and t o m ake sure t hat t he let t er you t yped is also seen t he sam e way on t he receiving end, t he Unicode Consort ium ( a nonprofit m ade up of represent at ives from t he com put er indust ry, academ ia, and com m unit y) creat ed t he Unicode charact er list ing in t he early 1990s, and m any program s t oday use t he accom panying Unicode Transform at ion Form at ( UTF) for t ext t ransfer. Google Docs also has a nat ive Unicode charact er list for you t o pick from . Pick I nsert from t he edit or m enu. A dialog like t he one shown in Figure 2- 8 will appear.

" Special charact ers"

You can select any charact er from t he dialog t o past e it int o your docum ent , or you can swit ch t o one of t he ot her groups—" Asian charact ers," " Wingdings" ( visible only on I nt ernet Explorer on Windows, at least am ong t he browsers we t est ed) , and " Advanced" —for m ore. Wingdings is a font , originally creat ed by Microsoft , m ade up of sym bols like a t elephone or a m ailbox. And t he advanced dialog gives you t he opt ion t o choose any Unicode charact er you like. The num ber 8634 result s in a circular arrow . The hexadecim al num ber 0x2665 , and 9730 an um brella . Typing t he hexadecim al value shows a heart . The num ber 9835 shows a not e 0x2603, on t he ot her hand, and increasing t he font size quit e a bit , result s in t he following:

Th e Google D ocs t e x t e dit or offe r s you a list of spe cia l ch a r a ct e r s t o pick fr om

H a ck 1 3 . Se a r ch a n d Re pla ce Te x t Usin g Re gu la r Ex pr e ssion s Want t o go beyond basic search and replace? Hack up som e " regex" wizardry. Google Docum ent s allows you t o search and replace t ext in your docum ent by select ing File Find and replace ( see Figure 2- 9) . But t his feat ure perm it s m ore t han plain replacem ent of one snippet wit h anot her. You get t he full range of so- called regular expressions ( select t he " Regular expression" checkbox) , a m ini program m ing language t hat deserves ( and has) a book's wort h of coverage; Jeffrey E. F. Friedl's Mast ering Regular Expressions, Third Edit ion ( O'Reilly) goes int o t his t opic in great det ail. The regular expression ( also known as regex) synt ax m ay seem crypt ic at first , but once you learn it , it offers a quick and powerful way t o replace t ext in your docum ent s. Here are som e regular expression replacem ent scenarios, along wit h an explanat ion of t he synt ax so t hat you can adapt t his for your own needs.

You cannot use Undo t o roll back changes m ade wit h Google's search- and- replace funct ion. Save your docum ent before m aking a change if you're unsure about t he result s. Som et im es replacem ent s—especially using regular expression synt ax—m ay do m ore t han you expect ed t hem t o do. For inst ance, unless t he " Mat ch whole word" opt ion is checked, replacing " federat ion" wit h " federat ions" would also change " confederat ion" t o " confederat ions" . Addit ionally, be aware t hat you also cannot always roll back a change by closing t he docum ent t o reopen it , because som et im es Google Docs docum ent s will be aut osaved even when you don't choose t o save it ( for inst ance, t his happens when you swit ch t o t he " Edit HTML" m ode, but it also happens in ot her circum st ances) . I n t hat case, you Revision need t o revert t o an older version of your docum ent by swit ching t o File hist ory.

Th e Fin d/ Re pla ce fu n ct ion for Google docu m e n t s. Th is fe a t u r e w a s in Alph a m ode a t t h e t im e of w r it in g, m e a n in g it 's e ve n le ss r e lia ble t h a n a Be t a r e le a se .

A pla in n on - r e gu la r e x pr e ssion r e pla ce m e n t Fin d: Napoleon Re pla ce w it h : Napoléon Ex pla n a t ion : Alt hough t he search- and- replace funct ion support s regular expressions, you don't need t o use t he special regular expression synt ax. You can sim ply ent er t wo plain t ext st rings. I n t his exam ple, all occurrences of t he word " Napoleon" are replaced wit h " Napoléon" . Re m ovin g r e fe r e n ce s t o e n dn ot e s Fin d: \[\d+\] Re pla ce w it h : leave blank Ex pla n a t ion : Given a t ext cont aining references t o endnot es in square bracket s, such as " [ 1] " , how would you go about rem oving everyt hing in square bracket s? Rem oving t he not es is easy, as you can j ust select t he end port ion of t he docum ent and hit t he delet e key. The answer t o rem oving any digit s surrounded by square bracket s is shown in t his regular expression. I n t his regex, you have t o escape t he square bracket s using \, because as you'll see in " Replacing obfuscat ed em ail addresses wit h real ones," t he square bracket s would ot herwise have a special m eaning. Wit hin t he bracket s, t he \d indicat es any digit , and t he + specifies " one or m ore" . Re pla cin g obfu sca t e d e m a il a ddr e sse s w it h r e a l on e s

Fin d: ([A-Za-z0-9_\+\.]+) at (\w+) dot (\w+) Re pla ce w it h : $1@$2.$3 Ex pla n a t ion : Som et im es, em ail addresses found on t he web use special synt ax like " som eone at exam ple dot com " t o defend from spam m ers. I n t his case, t he real em ail address behind t he obfuscat ed one would be som eone@exam ple.com . This regular expression aut om at es t he process by looking for a sequence of charact ers t hat are accept able in an em ail address usernam e: all alphabet ic charact ers ( A-Z and a-z) , num bers ( 0-9) , and som e sym bols ( + and .) . The + and . sym bols need t o be prefixed wit h t he escape charact er ( \) so t hat t hey are not int erpret ed as a special charact er. All of t hese charact ers are grouped in bracket s, which denot es t hey are a charact er class ( t hat is, t hey can m at ch any one of t hese sym bols) . The + im m ediat ely following t he charact er class specifies t hat t hey can m at ch one or m ore of t hese charact ers. Aft er t he em ail usernam e, t he regular expression m at ches a few m ore t hings: t he word " at " surrounded by spaces, one or m ore alphanum eric charact ers ( \w is an abbreviat ion for [A-Za-z0-9_]), t he word " dot " surrounded by spaces, and finally one or m ore alphanum eric charact ers. The replacem ent uses num eric references t o it em s t hat t he regular expression " capt ured" : anyt hing wit hin parent heses is st uffed int o $1 ( for t he first set of parent heses) , $2 ( for t he second) , $3, and so on. This regular expression can m at ch only one part icular t ype of obfuscat ed em ail address, and even so, it has it s lim it s. What if t he em ail address were " som eone at m ail dot exam ple dot com " ? Perhaps aft er st udying t he regular expressions in t his hack, and reading up som e m ore on t he t opic, you'll be able t o solve t hat problem . Ch a n gin g a da t e for m a t Fin d: ((Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec).*) (\d\d?), (\d{4}) Re pla ce w it h : $3 $1, $4 Ex pla n a t ion : I f you want t o replace one dat e form at wit h anot her, t his expression com es in handy. I t looks for all occurrences of t he form at " MONTHNAME DAY, YEAR" t o replace t hem wit h " DAY MONTH, YEAR" . The port ion of t he regular expression t hat m at ches t he m ont h uses a feat ure called alt ernat ion: various alt ernat ives are expressed bet ween t he pipe (|) sym bol. So t he first grouping ( $1) will m at ch Jan or Feb or Mar, and so on. I n order t o m at ch eit her t he t hree- let t er abbreviat ion or t he full nam e, t he alt ernat ives are followed by .*, which could m at ch anyt hing, including " Mary" or " Oct al" . What we're banking on here is t hat anyt hing of t he form specified ( a word, a num ber, a com m a, and anot her num ber) is very likely t o be a dat e. Did you not ice t hat we skipped a num ber in t he replacem ent expression? That 's because t he second grouping ($2) refers t o t he second set of parent heses, which are also t he sam e parent heses t hat separat e t he alt ernat ives. So if $1 m at ched " January" , $2 would have only m at ched " Jan" . Re m ovin g a ll H TM L t a gs Fin d: ]*> Re pla ce w it h : [ leave blank] Ex pla n a t ion : Suppose you have som e t ext t hat is full of unwant ed HTML t ext , like

or . This regular expression rem oves all t hose t ags for you. I t looks for any st ring t hat :

Begins wit h an opening less- t han sign ( such as

or

)

Opt ionally ( t he ? t hat follows / indicat es t he / is opt ional) has / as t he second charact er ( as in

)

Then it grabs everyt hing ( any charact er except a great er- t han sign: [>]*) up t o t he closing great er- t han sign (>) . Because Google Docs works line- by- line, it is unable t o rem ove t ags t hat span m ore t han one line, such as:



Pr e ce din g a ll dom a in n a m e s w it h " h t t p:/ / " Fin d: (([-\w]+\.)+[-\w]+) Re pla ce w it h : http://$1 Ex pla n a t ion : I f your t ext cont ains a lot of references t o dom ain nam es, like " Please go t o www.acm einc.com t o see our product page," you can aut om at ically add t he st ring " ht t p: / / " before each of t hem . This regular expression works by first looking for groups of let t ers and num bers ( \w, which is short hand for [0-9a-zA-Z_]) and hyphens, followed by a period, such as " foo." , " www." , and " m ail- server." Then it looks for a group of let t ers, num bers, and hyphens wit hout a period ( a t op- level dom ain nam e such as com , edu, or net ) . So t his regular expression would m at ch www.oreilly.com , using t he following st eps: www. oreilly. com As you've seen earlier, t he $1 refers t o t he group m at ched by t he first ( in t his case, out er) set of parent heses. The inner set of parent heses could be referred t o by $2, but it 's not needed because it 's a subset of what you're int erest ed in. Not e t hat when m at ching hyphens, t he - needs t o com e at t he beginning of t he [ ] group or be escaped wit h \ because it has special m eaning wit hin [ and ], as you saw in " Replacing obfuscat ed em ail addresses wit h real ones." H a ck in g t h e H a ck Som et im es you want t o replace not j ust wit hin t he visible t ext , but also wit hin t he underlying HTML source. However when you swit ch t o t he HTML m ode for a docum ent , t he Edit Find and replace m enu disappears. But you can work around t his lim it at ion by using a bookm ar klet, a browser bookm ark cont aining JavaScript . JavaScript also nat ively support s regular expressions. First , creat e a new bookm arklet as described in [ Hack # 16] . The basic JavaScript needed for t his is t he following replacem ent funct ion, where " a" is t he ( regular expression- based) st ring t o find, and " b" t he st ring t o replace wit h: javascript:(function(){ var ta = document.getElementById("wys_textarea"); ta.value =ta.value.replace("a", "b"); })()

To execut e t his funct ion, creat e a bookm arklet for it and click t he bookm ark while in t he " Edit HTML" m ode of your docum ent . But you can t ake t his m uch furt her by specifying a funct ion in place of " b" . Every t im e t hat " a" is m at ched, t he funct ion will be invoked, and t he value t hat it ret urns will replace " a" . For exam ple, suppose you want t o look for all occurrences of an < h3> t ag t o t hen insert a new anchor t ag in t he form of , where " 1" will be increm ent ed t hroughout t he docum ent . You can use a JavaScript bookm arklet t o do t his. First ,

init ialize a variable called counter. Then, creat e a funct ion t hat adds 1 t o t he count er and ret urns t he replacem ent st ring. Then, inst ead of specifying " b" , put in t he nam e of t he funct ion ( getNextH3 in t his exam ple) : javascript:( function() { counter = 0; function getNextH3() { counter++; return ""; } var ta = document.getElementById("wys_textarea"); ta.value =ta.value.replace(//g, getNextH3); })()

Not e t hat inst ead of a search t erm of t he form " a" , t he t erm com es in bet ween / and / . This anot her way t o specify a regular expression in JavaScript ( " a" and /a/ are equivalent ) . Using t hese charact ers allows you t o put a m odifier at t he end of t he regular expression, in t his case " g" , which specifies global search- and- replace. ( Ot herwise, you'd replace only t he first m at ch) . For m ore inform at ion on regular expressions in JavaScript , see Danny Goodm an's JavaScript & DHTML Cookbook, Second Edit ion ( O'Reilly) . —Brian Jepson and Philipp Lenssen

H a ck 1 4 . " Google D ocs Ligh t " for W e b Re se a r ch : Google N ot e book Set up your Google Not ebook t o copy snippet s and j ot down t hought s while surfing t he Web. You can t hink of Google Not ebook as a light weight sibling of Google Docs. As bot h a browser ext ension and a feat ure added t o your Google search result s, a Google Not ebook is som et hing you " carry around" while surfing; it let s you save sm all pieces of t ext or links for fut ure reference. You can also use it as a collaborat ive t ool for proj ect s in which a whole t eam is doing research on a specific t opic. Let 's j ust im agine our t opic at hand is pet s and pet food, for our new web sit e Pet FoodI nfo.exam ple.com , and t hat we want t o acquire m ore inform at ion in preparat ion for building t he sit e. We'll st art by heading over t o t he Google Not ebook hom e page at ht t p: / / google.com / not ebook t o inst all Not ebook. Aft er signing in wit h your Google Account [ Hack # 1] and agreeing t o t he t erm s of service, t he download for t he Google Not ebook browser ext ension will st art . ( Accept t he securit y dialog if one pops up, and reopen all browser windows if you're asked t o.)

N OTE At t he t im e of t his writ ing, t he browsers current ly support ed are I nt ernet Explorer 6 and lat er ( Windows XP only) and Firefox 1.5+ ( Windows XP and Vist a, Mac OS X, and Linux) .

Now when you visit t he Not ebook hom e page, you can creat e a new not ebook and t it le it " Pet s and pet food." Not es t hat you add here are saved as you go, as shown in Figure 2- 10. What 's m ore, you now have a Not ebook gadget added right t o your browser, which you can expand t o add not es t o while browsing any web page. Check t he bot t om right of your browser for t he " Open Not ebook" icon; clicking it expands t he m enu, as pict ured in Figure 2- 11. From t he Yahoo! Pet s hom e page, a not e reading " We need m ore cat cont ent ! " was added. The link below t he not e was generat ed by dragging and dropping a link from t hat page int o t he not e; in sim ilar fashion, you can also copy t ext found on any page.

Th e Google N ot e book h om e pa ge a ft e r sign in g in

Also, on Google search result pages, you will now find a link reading " Not e t his" below snippet s, as shown in Figure 2- 12. Click it and t he link t urns int o a " Duly not ed" m essage, and a Not ebook window pops up adding t he result link and snippet as a new not e ( on Google result s pages, t his works even when you don't have t he Not ebook browser ext ension inst alled) . Colla bor a t ive n ot e s To share your not es wit h friends, fam ily, or ot her m em bers of your t eam , select your not ebook on t he Not ebook hom e page and click t he " Sharing opt ions" link on t op. You can t hen invit e collaborat ors by list ing t heir em ails one by one ( com m a- separat ed) and clicking t he " Save Set t ings" but t on. ( Not e t hat people you invit e do not need t he Not ebook browser ext ension, t hough t hey do need a Google Account t o sign in.) Jane, t he user I 've invit ed in Figure 2- 13, will now receive an invit at ion em ail and can t hen edit along in t he sam e not ebook, at t he Refresh) , any changes sam e t im e I do. Aft er a short delay ( a few seconds, or whenever you select Tools m ade are synchronized on bot h ends. Con ve r t in g a N ot e book t o a Google D ocs docu m e n t I f you want t o, you can convert your Google Not ebook t o a Google Docs t ext docum ent at any t im e. Select Tools Export t o Google Docs from t he Not ebook m enu and a new docum ent opens, which you can t hen edit as usual. ( Not e t hat your new Docs t ext will not inherit t he sharing opt ions of t he Not ebook, so you will have t o configure t hem again if you want t he sam e users t o have access t o t he new docum ent .)

Ope n in g t h e Google N ot e book ( bot t om r igh t ) on t h e Ya h oo! Pe t s h om e pa ge t o a dd a n ot e

N ot in g t h e t h ir d w e b r e su lt in a se a r ch for pe t food

Ja n e a dde d com m e n t s t o t h e n ot e s; a s a colla bor a t or , sh e ca n a lso e dit a n y n ot e it se lf, or a dd n e w n ot e s t o t h is N ot e book

H a ck 1 5 . Con ve r t a W or d File I n t o a PD F w it h Google D ocs I f you need t o convert a Word docum ent int o a PDF—or one of m any ot her form at s—t ake it on a t rip int o and out of Google Docs. Even if you have no need t o st ore it or edit it on Google Docs, t his is a quick way t o generat e a PDF! Google Docs has bot h im port and export funct ionalit y. Using t he t wo in com binat ion m eans t hat you can convert docum ent s; for inst ance, you can upload a Word docum ent and save it as a PDF file. To upload a Word file, go t o t he Google Docs hom e page ( ht t p: / / docs.google.com ) and select Upload. I n t his exam ple, I 'm uploading a Word file cont aining a st ory by t he Grim m Brot hers, as pict ured in Figure 2- 14.

N OTE The m axim um size of an uploaded Word file, including em bedded im ages, was 500 KB at t he t im e of t his writ ing. I f you need t o convert a larger Word file, consider inst alling Adobe Acrobat , t he free Cut ePDF (ht t p: / / www.cut epdf.com ) , or t he free OpenOffice.org (ht t p: / / www.openoffice.org) , which can also save docum ent s as PDFs. Mac OS X can creat e PDFs nat ively from any applicat ion t hat can print .

Aft er t he upload finishes, you'll be t aken t o t he newly uploaded docum ent . Click t he File m enu and select Save as PDF as shown in Figure 2- 15. You will now be able t o download t he PDF, as shown in Figure 2- 16. How well t he layout survives t he conversion great ly depends on t he docum ent . For sim ple docum ent s, t he result s are usually good, but for m ore com plex ones you will see som e layout changes.

Th e sou r ce docu m e n t in W or d ( w it h a n illu st r a t ion by Elisa be t h M a r ia An n a Je r ich a u - Ba u m a n n )

Th e sa m e docu m e n t im por t e d in t o Google D ocs

An d fin a lly, t h e docu m e n t a s PD F

Google Docs support s a num ber of docum ent form at s, and t he list of support ed form at s changes from t im e t o t im e. Here's t he list t hat was current as of t he t im e of t his writ ing: File t ypes you can im port int o Google D ocs docu m e n t s:

HTML, t ext , Microsoft Word, Rich Text Form at , OpenOffice docum ent , St arOffice

File t ypes you can export from Google D ocs docu m e n t s:

HTML, t ext , Microsoft Word, Rich Text Form at , OpenOffice docum ent , PDF

File t ypes you can im port int o Google Spr e a dsh e e t s:

Com m a- Separat ed Values files, Microsoft Excel, OpenOffice spreadsheet

File t ypes you can export from Google Spr e a dsh e e t s:

HTML, t ext , Com m a- Separat ed Values files, Microsoft Excel, OpenOffice spreadsheet

File t ypes you can export from Google Pr e se n t a t ion s:

HTML

File t ypes you can im port int o Google Pr e se n t a t ion s:

Microsoft PowerPoint ( PPT and PPS)

H a ck 1 6 . W r it e a Ja va Scr ipt Book m a r k le t t o Tr a n sm ogr ify You r D ocu m e n t s Use som e JavaScript t rickery t o generat e t ables of cont ent s for your Google Docum ent s and perform ot her com plex t ext m anipulat ions. When you creat e a word processing docum ent in Google Docs, you can t urn any line int o a headline by clicking t he St yle but t on t o select Header 1 ( for t he m ain headline) , Header 2 ( for subsequent headlines) and so on. You " Publish as web page" . But what if you've creat ed a docum ent can t hen publish t he docum ent by using Share so long t hat it needs a t able of cont ent s t o aid your readers? Long web pages oft en use a linked t able of cont ent s at t he t op of t he docum ent ; t he reader clicks on it , and is aut om at ically t aken t o t he sect ion of int er est . Creat ing such a t able of cont ent s m anually in Google Docs can be a t edious j ob. You would have t o select your Bookm ark for each. Then, you would need t o click t he link icon, headlines one by one and choose I nsert select t he Bookm ark opt ion, find your bookm ark, and ent er t he headline's t ext —again, one by one. But t here's an easier way t o do t his: by using t he power of bookm arklet s. A bookm ar klet is a sm all JavaScript funct ion you can add as a browser bookm ark t o t hen run on any web page. Bookm arklet s can do sm aller j obs like advanced search and replace, count ing how oft en a word occurs on a page, or changing t he page color. And t hey can also be used t o creat e a t able of cont ent s. To t ry t his, creat e a new docum ent . I 'm creat ing one about t he phenom enon of synest hesia. I st yle t he m ain headline on t op as Header 1 using t he St yle but t on. All ot her headlines will be st yled as Header 2, as shown in Figure 2- 17. Edit HTML) , you will not ice t hat t he I f you check t he source of t he docum ent ( you can do t his by clicking Edit Header 2 is an " h2" elem ent . And t his is where t he bookm arklet com es in: it will look for any occurrence of t his elem ent and add an I D t o it . ( I t ignores " h1" wit h t he assum pt ion t hat h1 is used for t he chapt er t it le; you can also expand t he script if you want t o " cat ch" elem ent s ot her t han h2.) The I D in t urn will be linked t o t he t able of cont ent s, which you can creat e as an unordered list elem ent " ol," insert ed right before t he first h2.

Th e or igin a l docu m e n t , con t a in in g h e a dlin e s a n d pa r a gr a ph s

Here's t he JavaScript code accessing t he HTML Docum ent Obj ect Model, wit h spacing, line breaks, and com m ent s added for clarit y: Code View: javascript:(function(){ // grab the Google uses, then grab all 's in it var doc = document.getElementById("wys_frame").contentWindow.document; var headlines = doc.getElementsByTagName("h2"); if (headlines.length >= 1) { // insert an empty Table of Contents list element if none exists var toc = doc.getElementById("toc"); if (!toc) { toc = doc.createElement("ol"); toc.setAttribute("id", "toc"); headlines[0].parentNode.insertBefore(toc, headlines[0]); } toc.innerHTML = ""; // add an id to every & link it from the ToC for (var i = 0; i < headlines.length; i++) { var id = "toc" + (i + 1); toc.innerHTML += "

  • " + headlines[i].innerHTML + "
  • "; headlines[i].setAttribute("id", id); } } })()

    N OTE Modern browsers support linking t o I Ds. For ot her browsers, you can use HTML like t he following when generat ing t he Table of Cont ent s: Number form synesthesia.

    To add t his code as bookm arklet , you m ust com press t he JavaScript int o a single line, rem oving m ost spacing, com m ent s, and post it on a web page as a link so you can drag it t o your bookm ark bar. You can find t he bookm arklet at ht t p: / / blogoscoped.com / googleappshacks/ bookm arklet s.ht m l—j ust drag and drop t he link int o your bookm arks collect ion. To easily find a bookm arklet when you need it , consider adding it t o your link t oolbar, or creat ing a special " bookm arklet s" folder in your bookm arks. Now t hat you have t he bookm arklet , you can run it when you edit your docum ent , as shown in Figure 2- 18. Once clicked, a new linked list appears before your first Header 2. Clicking t he Creat e ToC bookm arklet again updat es t he list in case your headers changed in t he m eant im e. You can t hen save t he docum ent and publish it for ot hers t o see.

    N OTE Everyone wit h edit ing right s for your docum ent ( including you) will see an edit or inst ead of a norm al web page at t he URL t hat you used t o publish t he docum ent . To see t he sam e plain HTML page ot hers see, log out of your Google Account by clicking " Sign out " at t he t op right of Google Docs, or t em porarily swit ch t o anot her browser wit h which you didn't log in t o Google.

    H a ck in g t h e H a ck You can also get creat ive, and writ e bookm arklet s t hat do ot her t hings t o your docum ent s. For inst ance, t he following JavaScript —wit h spacing and line breaks added again ( you will need t o m ake it one line t o t urn it int o a bookm arklet ) —will add a black one- pixel border t o all im ages cont ained wit hin your docum ent ( overriding ot her st yles t hat m ay exist for im ages) : javascript:(function(){ var doc = document.getElementById("wys_frame").contentWindow.document; var elements = doc.getElementsByTagName("img"); for (var i = 0; i < elements.length; i++) { elements[i].setAttribute("style", "border: 5px solid #000"); } })()

    Ru n n in g t h e " Cr e a t e ToC" book m a r k le t

    H a ck 1 7 . Re m ove For m a t t in g Be for e Pa st in g Te x t I n t o a D ocu m e n t When you pull in t ext from ot her sources, here's how you can do it wit hout dragging in all of it s original form at t ing. Som et im es you want t o spice up your Google Docs docum ent by copying and past ing a quot e, source code, headline or any ot her piece of t ext from t he Web. There's only one problem wit h t hat : t he m at erial you past e in will bring along form at t ing from t he original docum ent . This can lead t o colors and font s t hat don't m at ch your docum ent , and it 's som et im es t ricky t o rem ove t his unwant ed form at t ing using j ust t he Docs t oolbar. ( Edit ing t he HTML in it s source code view is oft en t he only reliable alt ernat ive t o get back your nat ive docum ent st yling.) This problem m ay also appear when you are copying cont ent from one Docs docum ent t o anot her; suppose you m ove t he headline of your docum ent int o a t able of cont ent s docum ent , but you don't want it t o appear large and bold t here. So wouldn't it be nice if t he t ext past ed uses your nat ive docum ent st yles, and not hing but ? Google offers a Rem ove Form at t ing but t on t o t he right side of it s Docs edit or t oolbar—it 's t he let t er " T" wit h a sm all red " x" next t o it —but t his feat ure doesn't always work. But here's a sim ple alt ernat ive m et hod: before past ing your clipboard int o your docum ent , past e t he clipboard t ext int o t he browser address bar above your docum ent , j ust as t hough you were t yping in a URL ( it 's basically a big t ext area t hat you can use as a scrat chpad) . Now, select t he t ext t hat 's in t he address bar and copy it back t o t he clipboard. I n doing so, your clipboard cont ent s will have changed from rich t ext t o plain t ext —and you can now safely past e it int o your Docs docum ent ! You are also able t o use any ot her plain t ext edit or for t his j ob of freeing your clipboard t ext from exot ic form at t ing, but t he browser address bar is t he one place always right wit hin reach, even when you're sit t ing at a kiosk in an I nt ernet café, hot el, or airport , where t he only applicat ion you can run is a web browser. However, not e t hat t he address bar hack works only for clipboard cont ent t hat fit s on a single line; for cont ent spanning m ult iple lines, you need t o use a plain t ext edit or of som e kind—or, if none is in reach, j um p over t o any online plain t ext area—like t he one present ed at ht t p: / / google.com / language_t ools—t o copy and past e int o and out of.

    N OTE Google em ployee Mat t Cut t s suggest s t he " Copy Plain Text " Firefox ext ension as an alt ernat ive. You can get it at ht t ps: / / addons.m ozilla.org/ en- US/ firefox/ addon/ 134.

    H a ck 1 8 . Pr e t t ify You r D ocu m e n t w it h I n lin e St yle s I nvoke t he awesom e power of Cascading St yle Sheet s t o add st yle t o your Google Docs docum ent . The lack of form at t ing opt ions in Google Docs can be bot h blessing and curse. I t 's a blessing, because t he Docs int erface is rem arkably unclut t ered, which m akes it easier t o use for casual writ ing; you can clearly see t hat it doesn't carry t he legacy of a product t hat saw t he int roduct ion of m any rarely used exot ic opt ions. I f, on t he ot her hand, you'd like t o t weak t he docum ent layout a bit m ore, you m ight m iss som e of t he m enu and t oolbar ent ries available in program s such as OpenOffice.org Writ er or Microsoft Word. One way t o overcom e t he form at t ing lim it at ions t hat Google Docs im poses via it s sim plified m enus is t o swit ch t o t he Edit HTML m ode for advanced edit ing. I nst ead of a what - you- see- is- what - you- get int erface, here you will be present ed wit h t he docum ent source represent ed as HTML source. I t 's m ore confusing t o wade t hrough, but it allows you t o m ake use of a feat ure called inline st yles. HTML uses CSS ( Cascading St yle Sheet s) for st yling, and an inline st yle is sim ply a port ion of CSS included right wit hin t he HTML. Suppose t hat you want t o rest rict t he line lengt h of docum ent s. By default , Google Docs expands t o fill t he whole browser window; if you want t o share a docum ent wit h a colleague, however, you m ay want t o give t hem a bet t er reading experience, as full- widt h paragraphs can hurt readabilit y. For t his exam ple, I 'll use an art icle on t he superhero Superm an. As pict ured in Figure 2- 19, t he line lengt h covers t he full browser widt h, and t here's lit t le padding t o t he edit or's left and right borders. Edit HTML above t he t oolbar. Unless you im port ed t he docum ent or To rest rict t he line lengt h, click Edit previously st yled it using t he Google Docs layout opt ions, t he HTML you will see now is rat her m inim alist and consist s m ost ly of paragraph t ags—and " st rong" for bold and " em " ( em phasis) for it alic—like t he following:

    Superman is a comic book character created by Joe Shuster and Jerry Siegel. Originally spawned in 1932 and sold to DC (Detective Comics) in 1938, Superman went on to become one of ...



    To apply your own st yle, wrap t he whole docum ent wit h a " div" ( division) elem ent like t he following:

    Superman is a comic book character created ...

    ...

    ...

    This serves as cont ainer t o which you can apply t he st ylesheet , which you do by adding a " st yle" at t ribut e wit h t he widt h and padding definit ions:

    ...

    When you click t he " Back t o edit ing t he docum ent " link, you will find t he layout of your t ext changed t o som et hing m ore readable, as shown in Figure 2- 20. Now t hat your t ext is wrapped wit h a cont ainer, som e browsers will let you select it and adj ust t he widt h visually using t he m ouse.

    N OTE For a full list of layout changes t hat you can apply using CSS, t ake a look at t he official language specificat ion at ht t p: / / w3.org/ TR/ CSS21/ . Not e, however, t hat not all st yling is allowed in Google Docs; Google em ploys a " whit e list " of CSS propert ies, m eaning t hat anyt hing not on t he whit e list is prohibit ed and will be rem oved from your docum ent . ( Because Google docum ent s are host ed on ht t p: / / google.com , t here are cert ain securit y rest rict ions wit h t he HTML you produce.) To see such a CSS whit e list , t ake a look at ht t p: / / google.com / apis/ m aps/ docum ent at ion/ m applet s/ infowindowallowed.ht m l. Alt hough not specifically about Google Docs, t hat help page gives you a good idea of what 's allowed in Google Docs.

    M or e W a ys t o Ch a n ge t h e La you t of You r D ocu m e n t Add a n im a ge bor de r : At t he m om ent , Google doesn't offer you a m enu ent ry t o put a border around an Pict ure. But swit ch t o t he HTML view aft er insert ing an im age, and m odify t he im age you include via I nsert " im g" t ag t o include a st yle like t he following:

    Th e a r t icle 's lin e le n gt h fills t h e w h ole w in dow , h u r t in g r e a da bilit y u n le ss t h e br ow se r w in dow is r e size d

    A n e w la you t for t h e a r t icle

    Sw it ch t o a diffe r e n t fon t or fon t size : The docum ent edit or already includes a font m enu allowing you t o select a font and font size, but it s opt ions are lim it ed and you m ay want t o go for yet anot her font and size. ( I t 's wort h not ing t hat a font available on your com put er m ay not be available on som eone else's com put er, and as font s are not em bedded int o Google Docs files, anot her com put er m ay show a different fallback font .) Again, you can use a " div" cont ainer wrapped around your full docum ent , like t he following:

    ...

    N OTE A st at ic font size unit like " px" —pixels—can creat e accessibilit y problem s on cert ain syst em s where t he user requires a bigger font . I f you want t o use a font t hat scales bet t er wit h t he user preferences, and looks good on very large resolut ions, consider using a relat ive font size, such as " font - size: 120% " .

    But t here's one hurdle left yet for cert ain docum ent s. Google also insert s it s own st ylesheet s int o any docum ent you creat e, and if you have paragraph elem ent s wit hin your t ext , Google's st ylesheet will override your own st yle, m eaning t hat your font definit ion is ignored! To solve t his, you can rem ove all " p" t ags in t he HTML view and include t wo breaks bet ween any t wo paragraphs, like t he following:



    Th e t e x t is n ow j u st ifie d, a n d it u se s a n in cr e a se d lin e - h e igh t a n d fon t size

    Ju st ify you r t e x t : I f you set t he alignm ent of your t ext t hrough t he Docs edit or t oolbar, you are rest rict ed t o left alignm ent , cent er alignm ent and right alignm ent . One alignm ent you can't select is fully- j ust ified t ext , as shown in Figure 2- 21. Use t he following inline st yle for your " div" cont ainer t o achieve t his:

    ...

    I n cr e a se t h e lin e h e igh t : To increase t he line height of your docum ent , as shown in Figure 2- 21, add t he following st yle:

    ...

    The " em " unit represent s t he font height current ly in use for your docum ent . I t 's a relat ive unit , so it 's a bit m ore flexible t han st at ic ones like " px" . Ou t pu t you r w h ole t e x t in u ppe r ca se : To convert all your writ ing int o uppercase let t ers, use t he following st yle on your " div" cont ainer:

    ...

    I n cr e a se t h e le t t e r or w or d spa cin g: To increase t he space bet ween any t wo let t ers of your t ext , use a st yle like t he following:

    ...

    Negat ive values like " - 1px" are allowed as well. I f, on t he ot her hand, you want t o increase t he spacing bet ween t wo given words of your t ext , use t he following st yle on your " div" cont ainer:

    ...

    ( The " ex" unit refers t o t he height of a lowercase " x" in your current font .) Floa t t e x t / im a ge s a r ou n d ot h e r t e x t / im a ge s: I f you want t o posit ion one elem ent t o t he left or right of anot her elem ent , you can use t ables and include your elem ent wit hin a t able cell. Or you can use t he " float " st yle propert y, as shown here applied t o a paragraph:

    ...

    ...



    Use t h e sa m e la you t for m u lt iple docu m e n t s When you defined advanced layout opt ions using inline st yles, it can be handy t o reuse t he sam e t em plat e for several docum ent s. There are t wo basic ways t o do t his: you can copy t he HTML of a " div" cont ainer som ewhere t o st ore it ( for exam ple, in a Google Docs docum ent it self) , and t hen copy and past e it int o new docum ent s when you creat e t hem . There's an even easier way: you can open an exist ing docum ent t hat is already st yled, and t hen select File " Copy docum ent " from t he m enu. ( I f your previous docum ent was shared, you will see a dialog asking whet her t o keep t he exist ing sharing set t ings for t he copied docum ent ; click " Cancel" if your new docum ent should rem ain privat e at first .)

    TH E GOOGLE D OCS FAM I LY: GOOGLE SPREAD SH EETS Spr e a dsh e e t s ca n be u se d for m a n a gin g a ll k in ds of in for m a t ion . You m igh t t h in k fin a n ce a n d a ccou n t in g a r e t h e m ost com m on u se s for a spr e a dsh e e t , bu t Joe l Spolsk y, on e of t h e de ve lope r s be h in d M icr osoft Ex ce l 5 .0 , fou n d ou t ( a s h e t e lls in h is gr e a t book , Use r I n t e r fa ce D e sign for Progra m m ers, w h ich is a lso a va ila ble on lin e ) , m e r e ly k e e pin g list s is w h a t m ost pe ople do w it h t h e m . You ca n k e e p list s of you r book s, for in st a n ce , w it h t h e book t it le in t h e le ft colu m n of t h e spr e a dsh e e t t a ble a n d you r r a t in g, e x pr e sse d a s n u m be r fr om 1 t o 1 0 , in t h e r igh t colu m n . Google Spreadsheet s, part of t he Google Docs suit e ( see Chapt er 1 for an overview and int roduct ion) support s m uch m ore t han list s, but it is not as feat ure- rich as com pet ing deskt op product s like Microsoft Excel. However, as a web applicat ion, it does cont ain som e built - in nicet ies t hat t radit ional deskt op program s m ay not have, such as:

    A chat program next t o t he spreadsheet , in which you can discuss t he docum ent wit h your friends and colleagues

    A revision hist ory t hat allows you t o go back t o a docum ent from m inut es, days, weeks, or m ont hs ago ( or j ust com pare changes)

    Easy m ult iaut hor edit ing, including color indicat ors showing who is current ly edit ing what

    Form ulas t hat access real- t im e dat a—financial or ot herwise—from ot her web sit es and services

    Sharing docum ent s in real t im e wit h ot hers wit hout having t o m ake redundant , soon- t o- be- out dat ed copies

    Em bedding dynam ic spreadsheet s in a web page or blog post

    Google Spreadsheet s has a few int erest ing t ricks up it s sleeves. Read on t o learn how t o m ake it do all kinds of t hings.

    H a ck 1 9 . Add Live D a t a t o You r Spr e a dsh e e t Wouldn't it be nice if som e of your spreadsheet dat a aut om at ically creat ed and updat ed it self? Act ually, it 's very sim ple wit h t he GoogleLookup and GoogleFinance funct ions. Here's a quick quest ion: when was Mat t Groening, creat or of The Sim psons, born? The correct answer is February 15, 1954. Adm it t edly, I didn't know t hat eit her unt il I j ust looked it up on Google, using a feat ure called Google Q&A ( for " Quest ions & Answers" ) . Try it out yourself by ent ering m at t groening birt hday int o Google. On t op of t he result s you will find what 's called a onebox cont aining t he inform at ion, as shown in Figure 3- 1.

    M a t t Gr oe n in g's da t e of bir t h : Fe br u a r y 1 5 , 1 9 5 4 , a ppa r e n t ly

    Google Q&A is good for m ore t han j ust researching Mat t Groening's birt hday—it can t urn up a variet y of ot her inform at ion and t rivia. These result s are not provided by a hum an: inst ead, a Google program aut om at ically scours t he Web t o find t his inform at ion on sit es like Wikipedia, Brainyquot e.com , and m any m ore. Here are a couple of ot her queries t hat result in direct answers:

    The search sylvest er st allone birt hplace result s in " Sylvest er St allone—Place of Birt h: New York, New York, USA"

    The search berlin populat ion result s in " Berlin—Populat ion: 3,405,000 ( 11/ 2006) "

    The search lengt h of t he am azon river result s in " Am azon River —Lengt h: 6,400 KM ( 4,000 MI ) approx."

    The search m ass of bet elgeuse result s in " Bet elgeuse—Mass: 14 [ solar m asses] "

    The search barry lyndon direct or result s in " Barry Lyndon—Direct or: St anley Kubrick"

    The search cat ch- 22 aut hor result s in " Cat ch- 22—Aut hor: Joseph Heller"

    N OTE Google used t o provide a lot m ore " fun" queries, like " real nam e of Superm an" ; alas, m any of t hem have been rem oved by now. When you rely on t he Google Q&A feat ure, know t hat som et im es queries ret urn wrong answers; t hat answers aren't always st ruct ured alike ( one answer for a birt hplace quest ion m ay be " San Francisco," while anot her m ay be " Sherm an Oaks, CA," list ing t he st at e as well) ; and t hat cert ain quest ions m ay not be answered at all.

    All t hese queries can be broken int o t he t wo basic pieces: ent it ies and at t r ibut es. For inst ance, " Mat t Groening," " Berlin," and " Am azon river" are t he ent it ies. And " birt hday," " birt hplace," and " lengt h" are t he accom panying at t ribut es. To issue a query from wit hin a spreadsheet , you m ust be able t o express it in t erm s of ent it y and at t ribut e. This is where t he Google Spreadsheet s' GoogleLookup funct ion com es in. Google Look u p, Google 's Q& A da t a for you r spr e a dsh e e t To include Q&A dat a in your spreadsheet , use t he GoogleLookup funct ion. Let 's creat e a spreadsheet cont aining celebrit y inform at ion; you'll provide t he celebrit y nam e, and GoogleLookup provides t he result s for t he ot her fields. Open a new spreadsheet at ht t p: / / docs.google.com and ent er several celebrit y nam es in t he first colum n. Leave t he second and t hird colum ns, t it led " birt h dat e" and " birt hplace" em pt y for now, as shown in Figure 3- 2.

    Cr e a t in g a n a u t om a t e d ce le br it y in for m a t ion spr e a dsh e e t

    The GoogleLookup form ula has t he following st ruct ure: =GoogleLookup(entity, attribute)

    So, you can select t he cell next t o I saac Asim ov and ent er: =GoogleLookup("Isaac Asimov", "Birth date")

    As soon as you hit t he Ret urn key, t his cell's value is calculat ed for you; aft er a brief " loading" m essage, t he cell now cont ains t he value " January 2, 1920" ( in t his case, t he value is of st at ic nat ure, but ot her values like " populat ion" m ay change over t im e) . Hover your m ouse over any cell cont aining a GoogleLookup funct ion t o see what web sources Google used for t he dat a. You can now fill t he rest of t he cell wit h t his form ula, but it would be a bit redundant t o t ype t he ent it y value int o every cell. Go back t o t he cell cont aining Mr. Asim ov's birt hday and double- click t he cell t o edit it . Select t he ent it y value ( " I saac Asim ov" ) in t he form ula and t ype $A2 ( t he $ in front of t he A keeps A from changing t o B if you were t o copy or aut ofill cells from t he Birt h Dat e t o Birt h Place colum n) . Your form ula should now look like t his: =GoogleLookup($A2, "Birth date")

    I nst ead of hard- wiring t he nam e, you've replaced it wit h a variable point er ( you could also replace " Birt h dat e" in t he form ula wit h B$1; t he $ keeps 1 from changing t o 2, 3, et c. if you copy or aut ofill downward) . Now you're ready t o aut om at ically fill t he ot her cells. Copy t he cells cont aining t he form ula by pressing Ct rl- C, t hen select t he ot her cells below it and press Ct rl- V t o past e. Repeat t he sam e process wit h t he t hird colum n ( but use " Birt hplace" for t he at t ribut e) , and voilà—you've creat ed an aut om at ically updat ed celebrit y inform at ion spreadsheet , as shown in Figure 3- 3!

    N OTE

    You m ay need t o use Ct rl- C and Ct rl- V on t he Macint osh plat form , because Com m and- C/ V som et im es invokes t he operat ing syst em 's Copy/ Past e com m ands rat her t han t he ones build int o Google Spreadsheet s. But Google Spreadsheet s has it s own copy/ past e handlers wired up t o Ct rl- C and Ct rl- V, and because t hese don't have a funct ion on Mac OS X, t hey are m ore reliable.

    Th e da t e a n d pla ce va lu e s h a ve be e n a u t om a t ica lly fille d in

    At t he t im e of t his writ ing, Google allows a m axim um of 250 GoogleLookup funct ions per spreadsheet .

    Using t he " Publish" t ab, you can even t urn t his dat a int o a web page, or em bed t he t able in your hom epage ( Publish More Publishing Opt ions) [ Hack # 21] . Usin g Google Look u p Va lu e s a s Ar gu m e n t s for Ot h e r Ca lcu la t ion s You can also t ake result s ret urned from t he GoogleLookup funct ion and use t hem inside ot her form ulas in your spreadsheet . Som et im es it 's necessary t o clean up t he values ret urned by GoogleLookup, t hough. I n t he t able shown in Figure 3- 4, t he following form ula—wit h a hat t ip t o t he helping soul of t he Google Docs groups, André " Ahab" Banen—st rips unwant ed t ext out of populat ion values t o get an act ual num ber: =IFERROR( VALUE(LEFT(B2, FIND(" ", B2))), IFERROR(VALUE(B2)) )

    I n t his form ula, t he FI ND funct ion looks for t he first occurrence of a space charact er wit hin t he t ext cont ained in t he A2 cell. That 's because t he space charact er signals t he end of t he num eric value ( in Figure 3- 4, B2 cont ains " 107,449,525 ( July 2006 est .) " ) . I f t he space is found, t he LEFT funct ion t rim s t he B2 t ext down t o all t he charact ers up unt il t he space, and VALUE convert s t he result int o a num ber. I f t here is no blank available in t he num ber cell, an error is t hrown, which is caught by t he I FERROR funct ion, which ret urns t he second param et er if t he first param et er ret urns an error. And t his second param et er t akes what ever is in B2—you know by t hen t hat it didn't cont ain a space charact er—and ret urns it as a num ber using t he VALUE funct ion ( anot her I FERROR wrapper is used in case t he

    st ring can't be t urned int o a num ber for som e reason) . This t rick enables you t o ret rieve t he sum of t he populat ions—here, Mexico and Japan—by using t he form ula " = C2+ C3" . Anot her funct ion, nam ed GoogleFinance and explained in t he following sect ion, ret urns values t hat are a lit t le m ore st ruct ured.

    Addin g u p Google Look u p va lu e s

    Ge t Re a l- Tim e Fin a n ce D a t a The GoogleFinance funct ion is essent ially GoogleLookup's older sibling, but it provides finance dat a only. As wit h GoogleLookup, you need t o provide t wo values, but t hey're called sym bol and at t ribut e t his t im e: =GoogleFinance(symbol, attribute)

    For inst ance, t o find out t he current price of Yahoo st ock, you would writ e: =GoogleFinance("YHOO", "price")

    This funct ion ret urned " 23.25" , as shown in Figure 3- 5. The st ock price value com es wit h a delay of up t o 20 m inut es, according t o Google. Som e of t he ot her at t ribut es you can use are:

    pr ice ope n : The opening price of t he st ock for t he day

    h igh : The highest price t he st ock t raded for t he day

    low : The lowest price t he st ock t raded for t he day

    volu m e : The num ber of shares t raded of t his st ock for t he day

    m a r k e t ca p: The current m arket cap of t he st ock

    t r a de t im e : The last t im e t his st ock t raded

    h igh 5 2 : The 52- week high for t he st ock

    low 5 2 : The 52- week low for t he st ock

    shares: The quant it y of shares out st anding for t he st ock

    cu r r e n cy: The currency in which t he st ock is t raded

    For a full list of available at t ribut es, you can search t he Google Docs help file for " GoogleFinance."

    " W h e r e 's m y st ock a t ?" a n sw e r e d by Google Fin a n ce

    TH E GOOGLE D OCS FAM I LY: GOOGLE SPREAD SH EETS Spr e a dsh e e t s ca n be u se d for m a n a gin g a ll k in ds of in for m a t ion . You m igh t t h in k fin a n ce a n d a ccou n t in g a r e t h e m ost com m on u se s for a spr e a dsh e e t , bu t Joe l Spolsk y, on e of t h e de ve lope r s be h in d M icr osoft Ex ce l 5 .0 , fou n d ou t ( a s h e t e lls in h is gr e a t book , Use r I n t e r fa ce D e sign for Progra m m ers, w h ich is a lso a va ila ble on lin e ) , m e r e ly k e e pin g list s is w h a t m ost pe ople do w it h t h e m . You ca n k e e p list s of you r book s, for in st a n ce , w it h t h e book t it le in t h e le ft colu m n of t h e spr e a dsh e e t t a ble a n d you r r a t in g, e x pr e sse d a s n u m be r fr om 1 t o 1 0 , in t h e r igh t colu m n . Google Spreadsheet s, part of t he Google Docs suit e ( see Chapt er 1 for an overview and int roduct ion) support s m uch m ore t han list s, but it is not as feat ure- rich as com pet ing deskt op product s like Microsoft Excel. However, as a web applicat ion, it does cont ain som e built - in nicet ies t hat t radit ional deskt op program s m ay not have, such as:

    A chat program next t o t he spreadsheet , in which you can discuss t he docum ent wit h your friends and colleagues

    A revision hist ory t hat allows you t o go back t o a docum ent from m inut es, days, weeks, or m ont hs ago ( or j ust com pare changes)

    Easy m ult iaut hor edit ing, including color indicat ors showing who is current ly edit ing what

    Form ulas t hat access real- t im e dat a—financial or ot herwise—from ot her web sit es and services

    Sharing docum ent s in real t im e wit h ot hers wit hout having t o m ake redundant , soon- t o- be- out dat ed copies

    Em bedding dynam ic spreadsheet s in a web page or blog post

    Google Spreadsheet s has a few int erest ing t ricks up it s sleeves. Read on t o learn how t o m ake it do all kinds of t hings.

    H a ck 1 9 . Add Live D a t a t o You r Spr e a dsh e e t Wouldn't it be nice if som e of your spreadsheet dat a aut om at ically creat ed and updat ed it self? Act ually, it 's very sim ple wit h t he GoogleLookup and GoogleFinance funct ions. Here's a quick quest ion: when was Mat t Groening, creat or of The Sim psons, born? The correct answer is February 15, 1954. Adm it t edly, I didn't know t hat eit her unt il I j ust looked it up on Google, using a feat ure called Google Q&A ( for " Quest ions & Answers" ) . Try it out yourself by ent ering m at t groening birt hday int o Google. On t op of t he result s you will find what 's called a onebox cont aining t he inform at ion, as shown in Figure 3- 1.

    M a t t Gr oe n in g's da t e of bir t h : Fe br u a r y 1 5 , 1 9 5 4 , a ppa r e n t ly

    Google Q&A is good for m ore t han j ust researching Mat t Groening's birt hday—it can t urn up a variet y of ot her inform at ion and t rivia. These result s are not provided by a hum an: inst ead, a Google program aut om at ically scours t he Web t o find t his inform at ion on sit es like Wikipedia, Brainyquot e.com , and m any m ore. Here are a couple of ot her queries t hat result in direct answers:

    The search sylvest er st allone birt hplace result s in " Sylvest er St allone—Place of Birt h: New York, New York, USA"

    The search berlin populat ion result s in " Berlin—Populat ion: 3,405,000 ( 11/ 2006) "

    The search lengt h of t he am azon river result s in " Am azon River —Lengt h: 6,400 KM ( 4,000 MI ) approx."

    The search m ass of bet elgeuse result s in " Bet elgeuse—Mass: 14 [ solar m asses] "

    The search barry lyndon direct or result s in " Barry Lyndon—Direct or: St anley Kubrick"

    The search cat ch- 22 aut hor result s in " Cat ch- 22—Aut hor: Joseph Heller"

    N OTE Google used t o provide a lot m ore " fun" queries, like " real nam e of Superm an" ; alas, m any of t hem have been rem oved by now. When you rely on t he Google Q&A feat ure, know t hat som et im es queries ret urn wrong answers; t hat answers aren't always st ruct ured alike ( one answer for a birt hplace quest ion m ay be " San Francisco," while anot her m ay be " Sherm an Oaks, CA," list ing t he st at e as well) ; and t hat cert ain quest ions m ay not be answered at all.

    All t hese queries can be broken int o t he t wo basic pieces: ent it ies and at t r ibut es. For inst ance, " Mat t Groening," " Berlin," and " Am azon river" are t he ent it ies. And " birt hday," " birt hplace," and " lengt h" are t he accom panying at t ribut es. To issue a query from wit hin a spreadsheet , you m ust be able t o express it in t erm s of ent it y and at t ribut e. This is where t he Google Spreadsheet s' GoogleLookup funct ion com es in. Google Look u p, Google 's Q& A da t a for you r spr e a dsh e e t To include Q&A dat a in your spreadsheet , use t he GoogleLookup funct ion. Let 's creat e a spreadsheet cont aining celebrit y inform at ion; you'll provide t he celebrit y nam e, and GoogleLookup provides t he result s for t he ot her fields. Open a new spreadsheet at ht t p: / / docs.google.com and ent er several celebrit y nam es in t he first colum n. Leave t he second and t hird colum ns, t it led " birt h dat e" and " birt hplace" em pt y for now, as shown in Figure 3- 2.

    Cr e a t in g a n a u t om a t e d ce le br it y in for m a t ion spr e a dsh e e t

    The GoogleLookup form ula has t he following st ruct ure: =GoogleLookup(entity, attribute)

    So, you can select t he cell next t o I saac Asim ov and ent er: =GoogleLookup("Isaac Asimov", "Birth date")

    As soon as you hit t he Ret urn key, t his cell's value is calculat ed for you; aft er a brief " loading" m essage, t he cell now cont ains t he value " January 2, 1920" ( in t his case, t he value is of st at ic nat ure, but ot her values like " populat ion" m ay change over t im e) . Hover your m ouse over any cell cont aining a GoogleLookup funct ion t o see what web sources Google used for t he dat a. You can now fill t he rest of t he cell wit h t his form ula, but it would be a bit redundant t o t ype t he ent it y value int o every cell. Go back t o t he cell cont aining Mr. Asim ov's birt hday and double- click t he cell t o edit it . Select t he ent it y value ( " I saac Asim ov" ) in t he form ula and t ype $A2 ( t he $ in front of t he A keeps A from changing t o B if you were t o copy or aut ofill cells from t he Birt h Dat e t o Birt h Place colum n) . Your form ula should now look like t his: =GoogleLookup($A2, "Birth date")

    I nst ead of hard- wiring t he nam e, you've replaced it wit h a variable point er ( you could also replace " Birt h dat e" in t he form ula wit h B$1; t he $ keeps 1 from changing t o 2, 3, et c. if you copy or aut ofill downward) . Now you're ready t o aut om at ically fill t he ot her cells. Copy t he cells cont aining t he form ula by pressing Ct rl- C, t hen select t he ot her cells below it and press Ct rl- V t o past e. Repeat t he sam e process wit h t he t hird colum n ( but use " Birt hplace" for t he at t ribut e) , and voilà—you've creat ed an aut om at ically updat ed celebrit y inform at ion spreadsheet , as shown in Figure 3- 3!

    N OTE

    You m ay need t o use Ct rl- C and Ct rl- V on t he Macint osh plat form , because Com m and- C/ V som et im es invokes t he operat ing syst em 's Copy/ Past e com m ands rat her t han t he ones build int o Google Spreadsheet s. But Google Spreadsheet s has it s own copy/ past e handlers wired up t o Ct rl- C and Ct rl- V, and because t hese don't have a funct ion on Mac OS X, t hey are m ore reliable.

    Th e da t e a n d pla ce va lu e s h a ve be e n a u t om a t ica lly fille d in

    At t he t im e of t his writ ing, Google allows a m axim um of 250 GoogleLookup funct ions per spreadsheet .

    Using t he " Publish" t ab, you can even t urn t his dat a int o a web page, or em bed t he t able in your hom epage ( Publish More Publishing Opt ions) [ Hack # 21] . Usin g Google Look u p Va lu e s a s Ar gu m e n t s for Ot h e r Ca lcu la t ion s You can also t ake result s ret urned from t he GoogleLookup funct ion and use t hem inside ot her form ulas in your spreadsheet . Som et im es it 's necessary t o clean up t he values ret urned by GoogleLookup, t hough. I n t he t able shown in Figure 3- 4, t he following form ula—wit h a hat t ip t o t he helping soul of t he Google Docs groups, André " Ahab" Banen—st rips unwant ed t ext out of populat ion values t o get an act ual num ber: =IFERROR( VALUE(LEFT(B2, FIND(" ", B2))), IFERROR(VALUE(B2)) )

    I n t his form ula, t he FI ND funct ion looks for t he first occurrence of a space charact er wit hin t he t ext cont ained in t he A2 cell. That 's because t he space charact er signals t he end of t he num eric value ( in Figure 3- 4, B2 cont ains " 107,449,525 ( July 2006 est .) " ) . I f t he space is found, t he LEFT funct ion t rim s t he B2 t ext down t o all t he charact ers up unt il t he space, and VALUE convert s t he result int o a num ber. I f t here is no blank available in t he num ber cell, an error is t hrown, which is caught by t he I FERROR funct ion, which ret urns t he second param et er if t he first param et er ret urns an error. And t his second param et er t akes what ever is in B2—you know by t hen t hat it didn't cont ain a space charact er—and ret urns it as a num ber using t he VALUE funct ion ( anot her I FERROR wrapper is used in case t he

    st ring can't be t urned int o a num ber for som e reason) . This t rick enables you t o ret rieve t he sum of t he populat ions—here, Mexico and Japan—by using t he form ula " = C2+ C3" . Anot her funct ion, nam ed GoogleFinance and explained in t he following sect ion, ret urns values t hat are a lit t le m ore st ruct ured.

    Addin g u p Google Look u p va lu e s

    Ge t Re a l- Tim e Fin a n ce D a t a The GoogleFinance funct ion is essent ially GoogleLookup's older sibling, but it provides finance dat a only. As wit h GoogleLookup, you need t o provide t wo values, but t hey're called sym bol and at t ribut e t his t im e: =GoogleFinance(symbol, attribute)

    For inst ance, t o find out t he current price of Yahoo st ock, you would writ e: =GoogleFinance("YHOO", "price")

    This funct ion ret urned " 23.25" , as shown in Figure 3- 5. The st ock price value com es wit h a delay of up t o 20 m inut es, according t o Google. Som e of t he ot her at t ribut es you can use are:

    pr ice ope n : The opening price of t he st ock for t he day

    h igh : The highest price t he st ock t raded for t he day

    low : The lowest price t he st ock t raded for t he day

    volu m e : The num ber of shares t raded of t his st ock for t he day

    m a r k e t ca p: The current m arket cap of t he st ock

    t r a de t im e : The last t im e t his st ock t raded

    h igh 5 2 : The 52- week high for t he st ock

    low 5 2 : The 52- week low for t he st ock

    shares: The quant it y of shares out st anding for t he st ock

    cu r r e n cy: The currency in which t he st ock is t raded

    For a full list of available at t ribut es, you can search t he Google Docs help file for " GoogleFinance."

    " W h e r e 's m y st ock a t ?" a n sw e r e d by Google Fin a n ce

    H a ck 2 0 . Pick a W in n e r a t Ra n dom Use t he RAND funct ion in com binat ion wit h sort ing t o pick first - , second- , and t hird- place winners from a list . Google Spreadsheet s gives you m any form ulas. To view all of t hem —242, at t he t im e of t his writ ing—open a new spreadsheet at ht t p: / / docs.google.com , swit ch t o t he Form ulas t ab, and click t he " m ore" link t o t he right . You can now scroll t hrough t he different groups and j um p t o a help ent ry for a part icular form ula by select ing t he " m ore" link next t o t hem . The I NT funct ion, for exam ple, rounds a given num ber down t o it s int eger com ponent , t urning a 2.7 int o a 2. SEARCH ret urns t he posit ion of a t ext segm ent wit hin a longer st ring. The GoogleLookup funct ion polls dat a from t he Web [ Hack # 19] . Anot her int erest ing funct ion is RAND, which ret urns a random num ber bet ween 0 and 1. I nspired by David and Raina Hawley's " Random Sort ing" hack in Excel Hacks, 2nd Edit ion, here's how you can use RAND t o pick a winner from a list of part icipant s. First , creat e a list of part icipant s by adding a Nam e and a Rank colum n. Fill t he Nam e colum n wit h a list of nam es, as shown in Figure 3- 6. Now, select t he field next t o t he first part icipant , t ype =RAND() and hit ret urn ( or pick t he RAND funct ion from t he Form ulas m enu) . On som e syst em s, you can now select t he field and copy it ( Ct rl- C or right - click and select Copy) , and select all t he ot her fields next t o t he part icipant s and past e it ( Ct rl- V or right - click and select Past e) . However, on ot her syst em s, t his will copy t he result value and not t he funct ion; t o avoid t his result , click t he bot t om - right edge of t he source cell, and t hen drag it over t he ot her cells for RAND t o be aut om at ically filled in for t hem .

    N OTE You m ay need t o use Ct rl- C and Ct rl- V on t he Macint osh plat form , t oo, because Com m and- C/ V som et im es invokes t he operat ing syst em 's Copy/ Past e com m ands rat her t han t he ones build int o Google Spreadsheet s. But Google Spreadsheet s has it s own copy/ past e handlers wired up t o Ct rl- C and Ct rl- V, and because t hese don't have a funct ion on Mac OS X, t hey are m ore reliable.

    Each cont est ant from t he list now has a random num ber next t o it , and you can now sort t he list by t his num ber. To do so, click t he divider line j ust below t he Rank t o get t he sort opt ion t o appear. Next , sort t he colum n ( it doesn't m at t er whet her you choose A- Z or Z- A, because what you're aft er is a random result ) . Addit ionally, you can include a result sect ion t hat report s t he t op t hree cells ( using =A2, =A3, and =A4 respect ively) t o show t he winners, as pict ured in Figure 3- 7. Each t im e you click t he Sort opt ion, a new random list of winners is generat ed, since t he RAND funct ion calculat es a new value every t im e you perform an act ion.

    A Google Spr e a dsh e e t s list of con t e st a n t s

    Fr a n ce n e is r a n dom ly pick e d a s t h e fir st w in n e r

    H a ck 2 1 . Em be d You r Spr e a dsh e e t in a W e b Pa ge You can export a Google Spreadsheet t o an em beddable HTML form at , which you can t hen include in your blog or any ot her web page. There are different ways t o include spreadsheet dat a in a web page, such as a blog post ing. You can export t he spreadsheet t o HTML and copy t hat int o your web sit e's HTML edit or, for inst ance. This is a good quick and dirt y way t o do it , but as you'll see, t here are bet t er ways. Let 's st art wit h a spreadsheet list ing album releases of t he Beat les, as shown in Figure 3- 8.

    N OTE I com piled t he Beat les discography dat a wit h a lit t le help from t he Google Music service, which you can find by perform ing a Google.com web search for " beat les" and t hen clicking on t he album im age shown in t he result s. You can find t he spreadsheet at ht t p: / / spreadsheet s.google.com / ccc? key= pvm 6FPiylicL8KMnPUNzCcw —t his is a read- only view of t he dat a, but you can m ake a copy by Copy spreadsheet . choosing File

    Export HTML from t he Spreadsheet s m enu. A new To export t he discography dat a as HTML, select File browser window will open; view t he HTML source of t he page, and look for t he second opening " t able" t ag. Copy everyt hing from ( and including) t his t ag, up t o ( and including) t he corresponding closing " t able" t ag. I f you're using a rich t ext edit or for your web page or blog, swit ch t o HTML edit ing m ode ( Blogger's HTML edit ing m ode is shown in Figure 3- 9) . Next , past e t he t able you copied int o t he edit or, as shown in Figure 3- 9. Figure 3- 10 shows t he spreadsheet dat a em bedded in a Blogger blog.

    N OTE I f you find t hat t he HTML source appears as one long line, you can save t he HTML file t o your hard drive, and use t he HTML Tidy ut ilit y ( ht t p: / / t idy.sourceforge.net ) t o form at t he source in a m ore hum anfriendly way.

    The HTML for t his post , however, is bloat ed, and also doesn't aut om at ically updat e when you updat e your spreadsheet dat a source. A m ore direct way t o em bed a spreadsheet is t o choose t he Publish t ab in Google Spreadsheet s t o click " Publish now" ( check t he " Aut om at ically republish . . . " opt ion, t oo) . You can now select t he " More publishing opt ions" link and in t he dialog t hat opens, pick " HTML t o em bed in a webpage," as shown in Figure 3- 11. Aft er clicking " Generat e URL," past e t he code snippet provided t o you int o your blog's HTML edit or and publish t he post , as shown in Figure 3- 12.

    You r spr e a dsh e e t discogr a ph y

    Usin g t h e " Edit H TM L" vie w of Blogge r , you ca n pa st e t h e H TM L sou r ce fr om a n y pa ge

    Th e pu blish e d blog post , sh ow in g t h e discogr a ph y t a ble

    Google will offer you a so- called " I fram e" t o past e int o your web sit e. An I fram e, or inline fram e, is a browser window wit hin t he browser window, showing anot her web page. I f you are post ing t he spreadsheet t o a blog, it 's possible t hat t he I fram e will not be visible in som e RSS readers. Also not e t hat depending on your web page t em plat e, you m ay need t o adj ust t he I fram e's " widt h" propert y so t hat t he scroll bars t o t he right side will not be cut off.

    For yet anot her way t o add spreadsheet s dat a t o your web sit es, have a look at how t o use Spreadsheet s as a Cont ent Managem ent Syst em [ Hack # 22] .

    Th e pu blish in g opt ion s dia log

    Th e Be a t le s discogr a ph y in clu de d a s e m be dda ble H TM L

    H a ck 2 2 . Use Google Spr e a dsh e e t s a s a Con t e n t M a n a ge m e n t Syst e m By aut om at ically populat ing your web page wit h values from Spreadsheet cells and addressing t hem via JavaScript , you can creat e a m ini- CMS. Do you want t o enable your friend or colleague t o quickly edit som e t ext on your hom e page, but don't want t o set up a big cont ent m anagem ent syst em ( CMS) ? Use a Google Spreadsheet as dat a source, an idea first present ed by Todd Huss at ht t p: / / gabrit o.com . To get st art ed, creat e a new spreadsheet at ht t p: / / docs.google.com and insert t wo colum n t it les: one labeled " nam e" , t he ot her " cont ent " . Then creat e t wo sam ple rows, using t he nam es " headline1" and " paragraph1" , as shown in Figure 3- 13, and fill t he cont ent fields wit h som e t ext of your choice. You probably already have an HTML page where you want t o include t hese values now. I 'll pick a com pany I 'm calling " Wine for Sale 2000." Right now t he web page is a st at ic file t hat I haven't yet connect ed t o t he spreadsheet , as shown in Figure 3- 14. To em bed t he dynam ic headlines int o t he HTML page, you first need t o publish t he spreadsheet via t he " Publish" t ab. Select t he " Aut om at ically re- publish . . . " opt ion as well. The spreadsheet will now have a public address like t he following: http://spreadsheets.google.com/pub?key=pgFb21wR3O90hBx3GJULxOQ

    I highlight ed t he " key" part because you'll need it now. I nclude t he following snippet in your HTML, and replace t he key value, highlight ed again, wit h t he key from a spreadsheet you've published. Give ident ifiers t o t he headline and paragraph you want t o fill aut om at ically. Use values from t he nam e colum n of t he spreadsheet , as shown here ( headline1 and paragraph1) :



    What does t his JavaScript do? I t request s a JSON dat a packet from t he Google server and asks for t his dat a t o be sent t o t he " displayCont ent " funct ion you creat ed. JSON is short for " JavaScript Obj ect Not at ion," and it 's a dat a exchange form at useful for JavaScript and ot her languages. Now you can refresh t he page and see t hat your headline and paragraph aut om at ically adj ust t o t he spreadsheet values. And when anyone changes t he spreadsheet dat a, your page will updat e it self t oo!

    You should only share t he spreadsheet wit h people you t rust , because t hey can include HTML, and even JavaScript , int o your docum ent . To prot ect yourself against undesirable HTML and JavaScript you can use a JSON parser library at ht t p: / / j son.org/ j son2.j s, which com es wit h usage exam ples right in t he file.

    H a ck in g t h e H a ck There's only one problem wit h using JavaScript : it execut es inside t he browser ( on t he client side) and is t herefore less accessible t han st at ic HTML. For inst ance, search engine bot s will not be able t o see your t ext and correct ly index it ; also, som e m obile browsers m ay not render your page fully.

    For n ow , t h e sa m ple h om e pa ge displa ys st a t ic h e a dlin e s on ly

    To overcom e t his barrier, you can creat e t he HTML on t he server side, using a language like Pyt hon or PHP. For exam ple, t he lat est version of PHP support s t he JSON dat a form at . You can also use t he com m a- separat ed values ( CSV) out put of Google Spreadsheet s: Code View: name,content headline1,Welcome to WineForSale paragraph1,"We hope you enjoy your stay at our little place on the internet. On..."

    This is t he accom panying PHP snippet t o parse t his dat a ( replace t he key value highlight ed here wit h your own) :



    You don't need t o rest rict your spreadsheet values t o m anually edit ed ones, by t he way. Using t he GoogleLookup funct ion [ Hack # 19] , you can also access live dat a pulled from t he Web. I f you give one row t he nam e "brazil populat ion" and use t he form ula =GoogleLookup( " Brazil" , " populat ion" ) for it s cont ent , you can access t he result wit h t he following PHP, producing t he out put shown in Figure 3- 15:

    Brazil, with a population of , has several wine regions, including Andradas, Caldas, and Serra Gaucha.



    Th e w in e sh op, n ow w it h dyn a m ic h e a dlin e s de live r e d via Google Spr e a dsh e e t s

    H a ck 2 3 . Sh ow Ela pse d Tim e a s D a ys a n d H ou r s Using a form ula, you can convert values such as " 186 hours" int o t he m ore readable " 7 days 18 hours." I nspired by t he hack " Show Tot al Tim e as Days, Hours and Minut es" from David and Raina Hawley's Excel Hacks, 2nd Edit ion, I decided t o t ry t his out in Google docum ent s. To set up for t his hack, creat e a sim ple t im e m anagem ent t able, as shown in Figure 3- 16. The left colum n cont ains t he t asks—designing, program m ing, debugging, and so on—and t he right colum n cont ains t he hours spent for t his t ask. The overall t im e spent on t he proj ect is current ly displayed in hours, as shown in Figure 316, using t he following form ula: =sum(B2:B12)

    This adds up all num bers bet ween cells B2 and B12. I n t his case, t he result is 186 hours. Type " 186 hours in days" wit hout quot es int o a Google web search, and t he Google calculat or will t ell you t hat t his equals 7.75 days.

    N OTE For a full feat ure list of what t he Google calculat or can do for you, including answering such queries as " 17 * 22 - 3," " 200 USD in EUR," or " 42 in Rom an num erals," see ht t p: / / google.com / help/ calculat or.ht m l.

    You can get your spreadsheet t o display a m ore readable sum , t oo. To do t his, replace t he SUM form ula you used earlier wit h t his one ( select t he hours sum cell, double- click or press F2, replace t he form ula wit h what you see here, and press Ret urn or Ent er) : =INT( SUM(B2:B12) / 24 ) & " days " & MOD( SUM(B2:B12), 24 ) & " hours"

    The first part of t he form ula adds up all hours, divides t his by 24 ( t he num ber of hours in a day) , and rounds t he num ber down t o t he nearest int eger. The second part of t he form ula uses t he MOD funct ion ( m odulo arit hm et ic) , which t akes t wo param et ers, divides t he first param et er by t he second, t hen ret urns t he rem ainder. The result will display as " 7 days 18 hours," as shown in Figure 3- 17.

    Th e de ve lopm e n t t a sk s spr e a dsh e e t su m s t h e list of t a sk s t o a t ot a l of 1 8 6 h ou r s

    H a ck in g t h e H a ck This approach works fine, but you can m ake it m ore readable t hrough t he use of a nam ed range, an easy- t orem em ber label assigned t o a specific range of cells. I n Google Spreadsheet s, swit ch t o t he Form ulas t ab ( locat ed t oward t he t op of t he page) , click " Range nam es," and select " Define new." Nam e your range by using a label like " hours_spent " and select t he range of cells ( B2: B12) . ( See Figure 3- 18.) Save t he new range and close t he dialog, and you're ready t o replace your exist ing form ula wit h t he following: Code View: =INT( SUM(hours_spent) / 24 ) & " days " & MOD( SUM(hours_spent), 24 ) & " hours"

    Or, t o ret urn t he num ber of weeks, you can use t he following form ula, which expands t he form er one: =INT( SUM(hours_spent) / 24 / 7 ) & " weeks " & INT( MOD( SUM(hours_spent) / 24, 7 ) ) & " days " & MOD( SUM(hours_spent), 24 ) & " hours"

    Alt ernat ively, you m ay also want t o print an overview of t he t ot al hours spent in m ult iple form at s, such as seconds, m inut es, hours, days, weeks, and years. You can nam e result cells of calculat ions using t he range nam es feat ure t o sim plify t his st ep, as pict ured in Figure 3- 19, which also shows t he form ulas being used ( in t he neighboring gray cells) . For inst ance, t he weeks are calculat ed using t he following form ula ( inst ead of I NT, you can use FLOOR t o round down t o a precise dat e—t he level of precision is indicat ed by t he second param et er) : =FLOOR(days / 52.18, .01)

    H e r e is a m u ch m or e r e a da ble r e pr e se n t a t ion of t h e t im e you spe n t on va r iou s t a sk s

    Cr e a t in g a n e w r a n ge n a m e

    Sim u lt a n e ou sly sh ow in g t h e t ot a l t im e in diffe r e n t for m a t s

    H a ck 2 4 . : Sh ow t h e W e e k da y or M on t h of a D a t e To get from a dat e value t o t he act ual nam e of t he day—inspired by t he hack " Ret urn t he Weekday of a Dat e" from David and Raina Hawley's Excel Hacks, 2nd Edit ion—you need t o press a couple of different funct ions int o service. Am ong Google Spreadsheet 's funct ions are a few t hat let you get t he nam e of t he day or m ont h for a given dat e value. Take a look at t he sam ple spreadsheet wit h user regist rat ion dat es shown in Figure 3- 20. To t he left side, you can see a list of usernam es; next t o t hem , you can see t he dat e on which each user regist ered for t he service. Dat es are easy enough t o get int o a spreadsheet , but t o get t he spreadsheet t o print out t he weekday in every row, you'll need t o use som e funct ions. The funct ions you need t o pick t he weekday are called WEEKDAY and CHOOSE. The WEEKDAY funct ion ret urns a num ber from 1 t o 7, where 1 is Sunday, 2 is Monday, 3 is Tuesday and so on.

    N OTE Wondering how t o calculat e t he num ber of days t he user has been regist ered so far? Check out [ Hack # 25] for com plet e det ails.

    Try it out yourself by ent ering t he following int o any cell: =WEEKDAY(B2)

    This form ula shows t hat April 21, 2004 ( t he value in B2) , is a " 4" , which m eans Wednesday. ( A quick j um p over t o Google Calendar at ht t p: / / calendar.google.com verifies t his.) But t hat isn't very readable—you st ill need t o convert t his num ber int o t he nam e of t he weekday. To do t his, use t he CHOOSE funct ion, which t akes an index value as first param et er, and t hen decides on any of t he following param et er values provided based on t hat index. This becom es clear when you look at t he form ula necessary t o ret urn t he verbose weekday: Code View: =CHOOSE(WEEKDAY(B2), "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" )

    I f t he first param et er is 1, t he funct ion will choose " Sunday" ; if it 's 2, it will choose " Monday," and so on. Put t his form ula int o t he " Weekday regist ered" field in each colum n, and it will correct ly display t he day nam es as shown in Figure 3- 20. And if you prefer t he weekday t o be shown in abbreviat ed form , like " Sun," " Mon," and " Tue," you can wrap t his whole form ula in t he LEFT funct ion, which t akes t wo param et ers ( a t ext st ring and t he num ber of let t ers t o print ) :

    A u se r r e gist r a t ion da t e s t a ble in Google Spr e a dsh e e t s

    =LEFT( CHOOSE( WEEKDAY(B2), "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ), 3 )

    Sim ilarly, if you want t o show t he nam e of a m ont h, you can use t he MONTH funct ion: =CHOOSE( MONTH(B2), "January", "February", "March", "April", "May", "June", "July", "August", "October", "November", "December" )

    N OTE Alt hough t hese exam ples and t he Google Spreadsheet s form ula docum ent at ion show all funct ion nam es writ t en in uppercase, you can also writ e t hem in lowercase or m ixed case.

    H a ck 2 5 . Sh ow t h e D iffe r e n ce Be t w e e n Tw o D a t e s Solve t he quest ion " how long ago?" wit h a st raight forward form ula. Suppose you want t o find out t he num ber of days since a given dat e, such as when a user regist ered. Given a spreadsheet list ing t he dat es, as shown in Figure 3- 21 ( see [ Hack # 24] for t he weekday calculat ion) , t his is a st raight forward subt ract ion bet ween t wo dat es; t he current dat e, which you can access via t he NOW funct ion, m inus t he old dat e ( B2 for t he first dat a cell) : =INT( NOW() - B2 )

    The I NT funct ion cut s off t he fract ion of t he num ber by rounding it t o it s nearest int eger. This way, only full days will be print ed out . Change " B2" t o t he corresponding cell when you ent er t he form ula int o ot her fields, or click t he cell wit h t his form ula ( D2 in Figure 3- 21) t o highlight and drag t he handle in t he lower right t o copy t he form ula. You can now click t he sort bar below t he " # days regist ered" cell t o find out t hat user " j ohnny1" has been t he m ost loyal regist rant t o dat e, being wit h us for for 1,209 days already.

    Use r r e gist r a t ion da t e s in Google Spr e a dsh e e t s

    H a ck 2 6 . Au t om a t ica lly Com ple t e List s of Re la t e d I t e m s Google Spreadsheet s is sm art enough t o finish list s of inform at ion for you, and can even go beyond what Excel or OpenOffice.org can do. I t 's not unusual t o find list s of relat ed values in a a spreadsheet . For inst ance, you m ay com e across a list of weekdays. To fill out such a list , you can st art by t yping t he first t hree: Sunday Monday Tuesday

    You can aut om at ically grow t he list t o include t he ot her weekdays. You m ight have encount ered t his feat ure (aut o- fill) in Microsoft Excel. Select your list cells, and t hen drag t he handle in t he bot t om - right corner down over em pt y cells. Thanks t o t his feat ure, your list now reads: Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday Monday Tuesday ...

    This t rick works wit h ot her sequent ial list dat a t oo, like 1, 2, 3 or A, B, C and m ore. When Google Spreadsheet s is not able t o cont inue t he list dat a, it will j ust repeat t he exist ing dat a in a loop for t he repeat ed cells. H a ck in g t h e H a ck You can even grow arbit rary list s wit h a different feat ure: Magic- Fill. Open a new spreadsheet and t ype t he following superhero nam es int o t he cells: Batman Superman Wonder Woman

    Expanding t his list as usual will j ust repeat t he list . But here's a t rick: inst ead of j ust dragging t he handle in t he bot t om - right corner down, as shown in Figure 3- 22, t his t im e hold down t he Cont rol key ( Opt ion on t he Mac) while doing so. The list t hat appears will now show som et hing like t he following: Batman Superman Wonder Woman batman wonder woman superman green lantern spiderman jla

    aquaman the flash

    Con t in u in g a list w it h t h e M a gic- Fill fe a t u r e

    The Flash is a superhero; so is Spider- Man, and t he JLA is t he Just ice League of Am erica, a superhero group. But holy bat arang, how on eart h was Google able t o t ell t hat you are looking for new superhero nam es? This is cert ainly m ore t han you m ight be used t o from Excel. The answer t o t his feat ure lies in a m em ber of t he Google Labs service array called Google Set s. Give t he t ool a t ry by visit ing ht t p: / / labs.google.com / set s and ent er t he nam es George Clooney, Brad Pit t , and Harrison Ford int o t he first t hree boxes, as pict ured in Figure 3- 23. Press t he Large Set but t on, and you will see a list like t his one: brad pitt george clooney harrison ford tom cruise angelina jolie johnny depp julia roberts matt damon bruce willis jennifer lopez britney spears ...

    Not all am ong t he result s ret urned are m ale Hollywood act ors, as t he original nam es m ight have suggest ed, but Google seem s t o have underst ood your seed list cont ained U.S. celebrit y nam es. You can t ry t his wit h any ot her seed list , t oo ( t hough Google in cert ain cases won't be able t o find good result s for you) . Here are som e exam ple list s t hat you can t ry growing in Google Spreadsheet s or Google Set s: ford, hummer, bmw, ... martin scorsese, stanley kubrick, todd solondz, ... big mac, hamburger, cheeseburger, ...

    theory of relativity, quantum theory, ...

    Google Se t s, t h e ba sis for M a gic- Fill

    H a ck 2 7 . I m por t D a t a fr om W e b Sit e s Screenscrape bit s and pieces from any web page for aut om at ed inclusion in your spreadsheet s. Google Spreadsheet s offers you a set of default funct ions t o look up financial dat a, or t rivia from t heir Q&A dat abase [ Hack # 19] . But you can go beyond t his feat ure and access cust om dat a from any web page, such as a list of links from a blog, or a list of t it les or I SBN num bers from a bookseller's web sit e. There are four key funct ions t hat can im port ext ernal web dat a: im port Xm l, im port Dat a, im por t Ht m l, and googleReader. The m ost flexible of t hese is im port Xm l, as it t urns any kind of HTML int o st ruct ured dat a. Suppose t hat you want t o aut om at ically add a list of book t it les on t he subj ect of ext rem e sport s. Head over t o a bookseller's web sit e, like Barnes & Noble ( ht t p: / / barnesandnoble.com ) and perform a search for " ext rem e sport s" ; copy t he address of t he result s page, shown in Figure 3- 24. This URL m ight look like t he following: http://search.barnesandnoble.com/booksearch/results.asp?WRD=extreme+sports

    Now you hold t he first part t o successfully use t he im port XML funct ion: t he URL of t he source page. The second part of t he equat ion is t o t ell your spreadsheet specifically which HTML part of t hat page you want , by using XPat h, a language for specifying subset s of an XML ( or XHTML) docum ent . Open t he HTML source of t he Barnes & Noble page by right - clicking t he page and picking " View Page Source" from t he cont ext m enu. Check for t he HTML st ruct ure in which t he book t it les are list ed on t he page. I n t his case, t he surrounding HTML looks like t he following ( wit h indent ion and line breaks added for clarit y) :

    Maximum Ride ...

    One way t o describe t he posit ion of t he t it le is t hus t o say: anywhere in t he HTML, wit hin a div t ag of t he class " bc- desc" , t here's an " h2" t ag, and in it an " a" t ag—ext ract t he t ext wit hin it. I n XPat h synt ax, t his is expressed as: //div[@class='bc-desc']/h2/a/text()

    To explain, t he double slashes in t he beginning m ean " anywhere wit hin t he st ruct ure," whereas a single slash m eans " a child node im m ediat ely below t he current st ruct ure." The @ charact er denot es an at t ribut e. And text() grabs t he t ext node it self, t hough it 's opt ional for t he im port Xm l funct ion ( st ill, it 's good pract ice t o use it in case you use XPat h in ot her environm ent s) . To sum m arize, t he cell cont ent you want t o past e int o your spreadsheet is t he following ( all on one line) : =importXml("http://search.barnesandnoble.com/booksearch/results .asp?WRD=extreme+sports", "//div[@class='bc-desc']/h2/a/text()")

    I nsert t his form ula int o a cell, press Ret urn or Ent er and wait a few seconds. The result is a list like t he following, also shown in Figure 3- 25: Extreme Sports How Angel Peterson Got His Name

    Winterdance No Nest for the Wicket (Meg Langslow Series #7) Maximum Ride Bruce Lee's Fighting Method Maximum Ride Extreme Danger (Hardy Boys Undercover Brothers #1) The Contest The Summit (Everest Series #3)

    You can now share t his list [ Hack # 2] , em bed it in a blog [ Hack # 21] , or do anyt hing you could do wit h any ot her spreadsheet values.

    Th e Ba r n e s & N oble se a r ch r e su lt pa ge offe r s se m ist r u ct u r e d H TM L da t a , w h ich you ca n a cce ss in Google Spr e a dsh e e t s

    Usin g t h e im por t Xm l fu n ct ion , t h e r e 's n ow a n a u t om a t ica lly cr e a t e d list of book t it le s

    As soon as t he ext ernal web sit e's HTML layout changes, your XPat h—and wit h it , your aut om at ed spreadsheet list —m ight break. I t m akes sense t o check your list every now and t hen t o see whet her it 's st ill st able. Also, t ry t o find an XPat h t hat balances precision ( so you don't find elem ent s you don't need) wit h fuzziness ( so t hat you don't nest your st ruct ure t oo deeply and precisely, as t hat m akes t he XPat h m ore prone t o break when t he ext ernal HTML out put changes) .

    Ove r vie w of t h e D a t a I m por t Fu n ct ion s Here is an overview of Google Spreadsheet 's dat a im port funct ions, furt her described at ht t p: / / docs.google.com / support / spreadsheet s/ bin/ answer.py?answer= 75507 : im por t XM L =importXml(URL, XPath-query)

    Access an ext ernal XML or HTML file t o ret urn st ruct ured dat a via an XPat h query. The following exam ple code ret rieves t he book t it les as shown previously: =importXml("http://search.barnesandnoble.com/booksearch/results. asp?WRD=extreme+sports", "//div[@class='bc-desc']/h2/a/text()")

    im por t D a t a =importData(URL)

    Access an ext ernal CSV ( com m a- separat ed values) or TSV ( t ab- separat ed values) file. I n fact , t his works wit h any arbit rary URL, t hough t he dat a ret urned m ay not be t oo useful; for inst ance, using im port Dat a t o poll an

    HTML page m ight ret urn a list of elem ent s, each filling a single cell. Here is exam ple code, accessing t he out put of anot her spreadsheet ( rest rict ed t o t hat ot her spreadsheet 's cell range nam ed " m ainTable" ) : =importData("http://spreadsheets.google.com/pub?key=pvm6FPiylicLv KQbERrGJVQ&output=csv&gid=0&range=mainTable")

    im por t H t m l =importHtml(URL, "list" | "table", index)

    Grab an ext ernal web page's t able or list elem ent s. The index param et er indicat es t he posit ion of t hat t able/ list . The following exam ple ret rieves t he t able values from a blog post , as shown in Figure 3- 26, t o convert t hem t o cells of a Google Spreadsheet , as shown in Figure 3- 27: Code View: =importHtml("http://blogoscoped.com/archive/2007-09-10-n74.html", "table", 1)

    N OTE Whenever your form ula is showing an error, hover t he m ouse over t he cell t o see t he det ails for t his error.

    Th e sou r ce blog post in g fr om Google Blogoscope d . . .

    . . . a n d t h e blog post in g's t a ble , a u t om a t ica lly t u r n e d in t o a spr e a dsh e e t

    im por t Fe e d =importFeed(URL, [feed-query | item-query], [headers], [number-of-items])

    I m port an RSS or At om feed. The opt ional feed/ it em query param et er t ells t he funct ion which part s of t he dat a t o ret urn, accept ing t he values " feed" , " feed t it le" , " feed aut hor" , " feed descript ion" , " feed url" , " it em s" , " it em s aut hor" , " it em s t it le" , " it em s sum m ary" , " it em s url" , or " it em s creat ed" . The t hird param et er will be a Boolean value ( " t rue" or " false" ) specifying whet her you want colum n headers. The fourt h param et er lim it s t he num ber of ret urned it em s. This exam ple code pulls t he first four it em s from a blog's RSS feed: =importFeed("http://sethf.com/infothought/blog/index.rdf", "items", , 4)

    The following exam ple code pulls all it em t it les from a feed, as shown in Figure 3- 28: =importFeed("http://waxy.org/links/index.xml", "items title")

    This exam ple gat hers inform at ion about a feed, displaying colum n headers such as t it le, descript ion, and URL: =importFeed("http://feeds.feedburner.com/Googlified", "feed", true)

    Usin g t h e im por t Fe e d fu n ct ion t o displa y RSS or At om it e m s

    H a ck 2 8 . For m a t Ce lls Accor din g t o Th e ir Va lu e s Add a lit t le color t o your spreadsheet s t o bet t er visualize dat a. Google Spreadsheet s allows you t o add condit ional form at t ing t o cells. This m eans t hat you can com m and your spreadsheet , for inst ance, t o show every num ber great er t han 1000 in green, or t o use a yellow background color t o highlight cells cont aining t he word " John" . To get t his feat ure t o work for you, creat e a new spreadsheet or open an exist ing one. For sam ple purposes, I am creat ing a spreadsheet t o collect newslet t er subscribers, cont aining colum ns wit h t he subscriber's nam e, age, and profession as shown in Figure 3- 29. Once you've set up your spreadsheet , select all t he colum ns you want t o apply your condit ional form at t ing t o. They will appear highlight ed in blue. Right - click t hem , and select " Change form at wit h rules . . . " from t he cont ext m enu, as shown in Figure 3- 29. I n t he dialog t hat appears, you can now specify your cust om const raint s, and t he appropriat e form at t ing. Let 's say you want t o highlight in red all t hose cells where t he age of t he user list ed is below 18. I n t he drop- down box of t he dialog, select " Less t han," and in t he value box ent er " 18" ( wit hout quot es) , as shown in Figure 3- 30. This cust om color is applied t o all cells t hat m eet t he crit eria as soon as you hit t he " Save rules" but t on. The form at t ing will also appear in published versions of spreadsheet s.

    N OTE Condit ional form at t ing is also applied t o cells cont aining dynam ic values creat ed wit h spreadsheet form ulas.

    Addin g Gr a die n t s Condit ional form at t ing can help you visualize ranges of num bers in longer list ings. Let 's creat e a new colum n t o t he right t it led " Yearly incom e in " and add values for average incom e t o t he newslet t er subscriber list . Suppose t hat you want t o color lower incom es in red and higher incom es in green—and every incom e figure in bet ween using som e ot her color.

    Th e Google Spr e a dsh e e t s con t e x t m e n u offe r s t o le t you ch a n ge t h e ce ll for m a t t in g ba se d on cu st om r u le s

    Addin g a spe cia l for m a t t in g r u le for you n ge r n e w sle t t e r su bscr ibe r s

    A sa m ple im a ge se r ve s a s color r e fe r e n ce

    To help m e pick t he right in- bet ween colors, I creat ed a reference color gradient bet ween red and green using a paint program t hat I referred t o as I set up t he form at t ing rules. You can use m any different im age edit ors for t his purpose, like Phot oshop, Phot oPaint , GI MP, or Paint Shop Pro ( which you see in Figure 3- 31) . You can, of course, sim ply wing it and not generat e a gradient at all. Now you can select your incom e dat a cells and add all t he rules you need. Google Spreadsheet s will apply t he first rule it finds t o be t rue, ignoring subsequent ones down t he list , so you can sim ply define t he rules in t he following order, for a result as shown in Figure 3- 32:

    Great er t han 120,000: use light green

    Great er t han 60,000: use green

    Great er t han 30,000: use yellow/ light orange

    Great er t han 10,000: use orange

    Great er t han - 1: use red

    Cr e a t in g a color gr a die n t for you r spr e a dsh e e t

    H a ck 2 9 . Con ve r t Cu r r e n cie s W it h in You r Spr e a dsh e e t Use a lit t le screenscraping m agic t o convert one currency int o any ot her. Google Spreadsheet s' im port Xm l funct ion pulls ext ernal web sit e dat a int o your spreadsheet [ Hack # 27] . You can use t his feat ure for currency conversion, t oo. Suppose t hat you have a t able wit h paym ent s m ade t o you from a variet y of com panies, j ust like t he sam ple t able shown in Figure 3- 33. There are t hree colum ns: Com pany, USD, and EUR. The sam ple paym ent s are provided in USD; Universal Export s, for inst ance, paid $200. I t would be t edious if you had t o convert t he values int o Euros m anually for every row, but t here's a way t o aut om at e t his. First , you need t o find a good online currency convert er t o use for t he im port Xm l funct ion. To recap, t he Google Spreadsheet s im port Xm l form ula uses t wo param et ers: =importXml(URL, XPath)

    There's a variet y of currency convert ers, but you m ust pick one t hat can be accessed using URL param et ers ( so t hat you can provide a URL cont aining t he dollar am ount and t he " from " and " t o" currencies t o t he im port Xm l funct ion) , and t hat also ret urns HTML t hat is easy t o parse ( because you will need t o writ e a lit t le XPat h query t o ret rieve t he result ) . Google, t oo has currency conversion in search result s, but t hey are not always form at t ed plainly enough. However, a service from Yahoo! Finance fit s your needs perfect ly. A URL like t he following one: http://finance.yahoo.com/currency/convert?amt=750&from=USD&to=EUR

    ret urns a result as shown in Figure 3- 34. The conversion result s are em bedded in an HTML t able of t he class " yfnc_dat am odout line1." This cont ains t he Euro value in t he second row, t hird colum n ( 508.5435 in Figure 334) . Hence, t he XPat h t o query for t his num ber is: //table[@class='yfnc_datamodoutline1']//tr[2]//td[5]

    The com plet e im port Xm l funct ion call is ( t his should all be kept on one line) : Code View: =importXml("http://finance.yahoo.com/currency/convert?amt=750&from=USD&to=EUR", "//table[@class='yfnc_datamodoutline1']//tr[2]//td[5]")

    To m ake t he form ula m ore flexible, you need t o replace t he values 750, USD, and EUR wit h t heir respect ive cell nam es, as shown here for t he " Acm e I nc" row: Code View: =importXml("http://finance.yahoo.com/currency/convert?amt="& B2& "&from=" & B1 & "&to=" & C1, "//table[@class='yfnc_datamodoutline1']//tr[2]//td[5]/b")

    Repeat t his form ula for all t he ot her cells in your spreadsheet , using t he correct cell nam es.

    Th e or igin a l t a ble doe s n ot in clu de

    va lu e s ye t

    Not ice in Figure 3- 35, t hat t he Euro values are aut om at ically filled in for you! Whenever you change a USD value on t he left side, t he values will aut om at ically updat e, t oo. Also, you can replace EUR wit h, say, GBP for Brit ish Pounds, and t he values will again be updat ed wit hin seconds. To find t he correct currency abbreviat ion—from t he Solom on I slands Dollar " SBD" t o t he Viet nam Dong " VND" —you can go back t o t he Yahoo! Finance page and inspect t he values cont ained in t he drop- down box.

    There's current ly a lim it of 50 im port Xm l operat ions in a spreadsheet .

    Th e Ya h oo! Fin a n ce cu r r e n cy con ve r t e r is t h e br a in s be h in d ou r ope r a t ion

    Th e va lu e s ca lcu la t e d by im por t Xm l, u t ilizin g Ya h oo! Fin a n ce

    TH E GOOGLE D OCS FAM I LY: GOOGLE PRESEN TATI ON S ( Slide 1 : I n t r odu cin g Google Pr e se n t a t ion s.) Tw e n t y ye a r s a ft e r t h e r e le a se of t h e fir st ve r sion of t h e be love d a n d fe a r e d Pow e r Poin t ( code n a m e d " Pr e se n t e r " du r in g pr odu ct ion ) , Google r e le a se d Google Pr e se n t a t ion s ( code n a m e d " Pr e se n t ly" du r in g pr odu ct ion ) in 2 0 0 7 . Alt h ou gh t h e t w o pr odu ct s fit br oa dly in t h e sa m e spa ce , Google Pr e se n t a t ion s is n ot a s fe a t u r e - r ich a s M icr osoft Pow e r Poin t or Ope n Office .or g I m pr e ss ye t . At t he t im e of t his writ ing, t he browser- based Google Present at ions edit or allowed you t o:

    Creat e slides wit h rich t ext and im ages

    Use t hem es ( including specific color schem es, font s, and background im ages)

    I m port PowerPoint ( PPT) files, wit h som e lim it at ions

    Use t he revision hist ory t o review and revert t o older versions of a present at ion

    Share a present at ion as a web page

    Export a present at ion as a st at ic HTML docum ent

    Print a present at ion

    Anot her feat ure of Present at ions is collaborat ion, and at least in t hat regard, it offers m ore t han som e of it s deskt op com pet it ors do. Not only can you edit a present at ion wit h som eone else, seeing t he changes t hey m ake reflect ed in your docum ent in real t im e, but you can also present t o a group online [ Hack # 2] . ( On t o Slide 2 : H a ck in g Google Pr e se n t a t ion s...)

    H a ck 3 0 . Add a Cu st om Pr e se n t a t ion Th e m e Don't lim it yourself t o t he default t hem es available in Google Present at ions. Here's how t o go beyond t hose default s. Google Present at ions offers only a sm all set of predefined layout s for your present at ion. But what if you want t o do som et hing unique, such as get t ing your com pany logo and background colors on every slide of t he present at ion? Th e " Ch a n ge Ba ck gr ou n d" D ia log One way t o do t his is t o right - click a blank part of any slide, and t hen select " Change background" from t he cont ext m enu. A dialog like t he one shown in Figure 4- 1 will pop up. Click t he " I nsert im age" link t o upload an im age or click t he color bucket icon t o pick a new background color. When done, check t he " Apply background t o all slides" checkbox, and click Save.

    Th e Ch a n ge ba ck gr ou n d dia log

    D ir e ct ly Adj u st in g t h e St yle sh e e t Anot her way t o t weak your present at ion's background im age and colors is t o export t he present at ion as a ZI P file, and t hen adj ust t he t hem e's st ylesheet . To do so, open an exist ing present at ion, or creat e a new one. Now, select Change Them e from t he t op m enu and pick t he Gradient Whit e t hem e ( t hough ot her t hem es work as well) , as pict ured in Figure 4- 2. Then choose File Save as ZI P from t he m enu and pick a locat ion on your com put er. I f you ext ract t he ZI P file and open t he folder, you will not ice t hat Google provided you wit h a set of HTML files, st ylesheet s, and im ages, as well as JavaScript library files. Open t he HTML file in t he m ain folder—in t he case of m y sam ple present at ion, it 's called All_About _Tea.ht m l—in your browser t o have a look.

    Se le ct on e of t h e pr e de fin e d t h e m e s in Google Pr e se n t a t ion s

    Next , locat e t he m ain background im age of your present at ion by opening t he folder files/ t hem es/ gradient whit e.

    I n it , you will find t he pict ure gradient whit e_sm .png; open it in an im age edit or, replace it wit h your design, and save t he im age ( but don't change t he filenam e) . You can creat e an im age from scrat ch, as long as you give it t he dim ensions 800 x 600 and save it over t he old im age locat ion in PNG form at . Check t he result ing present at ion in t he browser t o see if you're happy wit h t he design. You can now upload t he present at ion folder t o a web server, and send t he link t o ot her people. You could also zip t he present at ion up and send it t o ot hers as an em ail at t achm ent .

    N OTE I n order t o not replace t he background im age over and over whenever you export a new present at ion, next t im e j ust copy your present at ion's specific HTML file and folder t o your server's present at ion fram ework folder. For inst ance, if your present at ion is called " All About Tea," t hen j ust m ove t he files All_About _Tea.ht m l and t he accom panying folder All_About _Tea_im ages int o your prepared m ain present at ions folder. That folder, which you can call ( for exam ple) Present at ions, now st ores all of your export ed present at ions. There's a nice bonus t o t his approach: anyt im e you now m ake a change t o t he t hem e st ylesheet , every present at ion on t he server will aut om at ically adj ust t o t he new layout —as long as all t he present at ions use t he " gradient whit e" t hem e t hat you overrode.

    This hack com es wit h a couple of caveat s. Probably t he m ost serious issue when export ing a present at ion is t hat you're losing t he capabilit y t o collaborat e on it wit h ot hers, or m ake lat er changes t o it via Google Docs, as t he ZI P file was sim ply a st at ic copy of what your present at ion looked like at t he t im e of t he export . Also, anot her, general issue wit h background im ages for t hem es is t hat t hey don't sm oot hly scale for any resolut ion; for inst ance, your com pany logo m ay appear " j aggy" if scaled up t o resolut ions higher t han 800 x 600.

    H a ck in g t h e H a ck Ot her t han j ust changing t he background im age, if you know a bit about CSS synt ax, you can also t weak font s and colors t o your liking. Open your t hem e's CSS file (files/ t hem es/ gradient whit e/ t hem e.css) wit h a sim ple t ext edit or and m ake t he desired changes. For inst ance, t he file cont ains t he following code: /* Default Body Content */ .goog-presently-theme-gradientwhite { font-family: Helvetica, Arial, sans-serif; color: #333; background-color: #333; }

    I f you am end t he color propert ies t o read as follows, your present at ion font will appear in dark red inst ant ly—on every slide, as shown in Figure 4- 3: ... color: rgb(137,1,18); background-color: rgb(215,210,179); ...

    You r pr e se n t a t ion a ft e r cu st om izin g t h e t h e m e

    TH E GOOGLE D OCS FAM I LY: GOOGLE PRESEN TATI ON S ( Slide 1 : I n t r odu cin g Google Pr e se n t a t ion s.) Tw e n t y ye a r s a ft e r t h e r e le a se of t h e fir st ve r sion of t h e be love d a n d fe a r e d Pow e r Poin t ( code n a m e d " Pr e se n t e r " du r in g pr odu ct ion ) , Google r e le a se d Google Pr e se n t a t ion s ( code n a m e d " Pr e se n t ly" du r in g pr odu ct ion ) in 2 0 0 7 . Alt h ou gh t h e t w o pr odu ct s fit br oa dly in t h e sa m e spa ce , Google Pr e se n t a t ion s is n ot a s fe a t u r e - r ich a s M icr osoft Pow e r Poin t or Ope n Office .or g I m pr e ss ye t . At t he t im e of t his writ ing, t he browser- based Google Present at ions edit or allowed you t o:

    Creat e slides wit h rich t ext and im ages

    Use t hem es ( including specific color schem es, font s, and background im ages)

    I m port PowerPoint ( PPT) files, wit h som e lim it at ions

    Use t he revision hist ory t o review and revert t o older versions of a present at ion

    Share a present at ion as a web page

    Export a present at ion as a st at ic HTML docum ent

    Print a present at ion

    Anot her feat ure of Present at ions is collaborat ion, and at least in t hat regard, it offers m ore t han som e of it s deskt op com pet it ors do. Not only can you edit a present at ion wit h som eone else, seeing t he changes t hey m ake reflect ed in your docum ent in real t im e, but you can also present t o a group online [ Hack # 2] . ( On t o Slide 2 : H a ck in g Google Pr e se n t a t ion s...)

    H a ck 3 0 . Add a Cu st om Pr e se n t a t ion Th e m e Don't lim it yourself t o t he default t hem es available in Google Present at ions. Here's how t o go beyond t hose default s. Google Present at ions offers only a sm all set of predefined layout s for your present at ion. But what if you want t o do som et hing unique, such as get t ing your com pany logo and background colors on every slide of t he present at ion? Th e " Ch a n ge Ba ck gr ou n d" D ia log One way t o do t his is t o right - click a blank part of any slide, and t hen select " Change background" from t he cont ext m enu. A dialog like t he one shown in Figure 4- 1 will pop up. Click t he " I nsert im age" link t o upload an im age or click t he color bucket icon t o pick a new background color. When done, check t he " Apply background t o all slides" checkbox, and click Save.

    Th e Ch a n ge ba ck gr ou n d dia log

    D ir e ct ly Adj u st in g t h e St yle sh e e t Anot her way t o t weak your present at ion's background im age and colors is t o export t he present at ion as a ZI P file, and t hen adj ust t he t hem e's st ylesheet . To do so, open an exist ing present at ion, or creat e a new one. Now, select Change Them e from t he t op m enu and pick t he Gradient Whit e t hem e ( t hough ot her t hem es work as well) , as pict ured in Figure 4- 2. Then choose File Save as ZI P from t he m enu and pick a locat ion on your com put er. I f you ext ract t he ZI P file and open t he folder, you will not ice t hat Google provided you wit h a set of HTML files, st ylesheet s, and im ages, as well as JavaScript library files. Open t he HTML file in t he m ain folder—in t he case of m y sam ple present at ion, it 's called All_About _Tea.ht m l—in your browser t o have a look.

    Se le ct on e of t h e pr e de fin e d t h e m e s in Google Pr e se n t a t ion s

    Next , locat e t he m ain background im age of your present at ion by opening t he folder files/ t hem es/ gradient whit e.

    I n it , you will find t he pict ure gradient whit e_sm .png; open it in an im age edit or, replace it wit h your design, and save t he im age ( but don't change t he filenam e) . You can creat e an im age from scrat ch, as long as you give it t he dim ensions 800 x 600 and save it over t he old im age locat ion in PNG form at . Check t he result ing present at ion in t he browser t o see if you're happy wit h t he design. You can now upload t he present at ion folder t o a web server, and send t he link t o ot her people. You could also zip t he present at ion up and send it t o ot hers as an em ail at t achm ent .

    N OTE I n order t o not replace t he background im age over and over whenever you export a new present at ion, next t im e j ust copy your present at ion's specific HTML file and folder t o your server's present at ion fram ework folder. For inst ance, if your present at ion is called " All About Tea," t hen j ust m ove t he files All_About _Tea.ht m l and t he accom panying folder All_About _Tea_im ages int o your prepared m ain present at ions folder. That folder, which you can call ( for exam ple) Present at ions, now st ores all of your export ed present at ions. There's a nice bonus t o t his approach: anyt im e you now m ake a change t o t he t hem e st ylesheet , every present at ion on t he server will aut om at ically adj ust t o t he new layout —as long as all t he present at ions use t he " gradient whit e" t hem e t hat you overrode.

    This hack com es wit h a couple of caveat s. Probably t he m ost serious issue when export ing a present at ion is t hat you're losing t he capabilit y t o collaborat e on it wit h ot hers, or m ake lat er changes t o it via Google Docs, as t he ZI P file was sim ply a st at ic copy of what your present at ion looked like at t he t im e of t he export . Also, anot her, general issue wit h background im ages for t hem es is t hat t hey don't sm oot hly scale for any resolut ion; for inst ance, your com pany logo m ay appear " j aggy" if scaled up t o resolut ions higher t han 800 x 600.

    H a ck in g t h e H a ck Ot her t han j ust changing t he background im age, if you know a bit about CSS synt ax, you can also t weak font s and colors t o your liking. Open your t hem e's CSS file (files/ t hem es/ gradient whit e/ t hem e.css) wit h a sim ple t ext edit or and m ake t he desired changes. For inst ance, t he file cont ains t he following code: /* Default Body Content */ .goog-presently-theme-gradientwhite { font-family: Helvetica, Arial, sans-serif; color: #333; background-color: #333; }

    I f you am end t he color propert ies t o read as follows, your present at ion font will appear in dark red inst ant ly—on every slide, as shown in Figure 4- 3: ... color: rgb(137,1,18); background-color: rgb(215,210,179); ...

    You r pr e se n t a t ion a ft e r cu st om izin g t h e t h e m e

    H a ck 3 1 . Fin d I m a ge s for You r Pr e se n t a t ion Not an art ist or great phot ographer yourself, or j ust in a hurry t o find t he right im age t o help get your point across? Look for work wit h special free- t o- share licenses. I f you want t o spice up your Google Present at ion wit h a t elling visual, and you don't have a graphic designer t o provide you wit h a cust om - m ade one, you m ight be t em pt ed t o head st raight t o Google I m ages t o perform a search. Unfort unat ely, it 's not always easy t o det erm ine t he copyright st at us of im ages you find on Google I m ages, and det erm ining what is wit hin your " fair use" right s for republishing copyright ed im ages can get com plicat ed and m ay require legal advice ( and obt aining perm ission t o use a copyright ed im age is usually rat her t im e- consum ing) . One way t o m ake sure you are allowed t o use a given pict ure is t o look for it in public dom ain resources. For inst ance, very old pict ures m ay be in t he public dom ain, which is essent ially a copyright - free zone. There are also websit es dedicat ed t o offering you public dom ain clip art , like t he ext ensive ht t p: / / www.openclipart .org. Th e Cr e a t ive Com m on s But what about finding high- qualit y and recent phot os? Ent er t he Creat ive Com m ons init iat ive (ht t p: / / creat ivecom m ons.org) . Creat ive Com m ons is a licensing schem e t hat allows t he publisher of a work t o choose from am ong a set of " som e right s reserved" licensing t erm s. For inst ance, a phot ographer m ay allow anyone t o reuse a phot o in noncom m ercial cont ext s, as long as t he phot o source is appropriat ely credit ed. Many web sit es offer Creat ive Com m ons licensed m at erial, but your first st op should be t he phot o- sharing web sit e Flickr. I nst ead of ent ering t hrough t he front door, which offers only a general phot o search, point your browser t o ht t p: / / flickr.com / search/ ?l= cc for t he Creat ive Com m ons–only search engine. Ent er a keyword, such as " skyscraper," and look t hrough t he result s for a fit t ing im age, as shown in Figure 4- 4. You can also visit ht t p: / / www.flickr.com / creat ivecom m ons/ , select j ust a single variant of t he Creat ive Com m ons license, and search for phot os t hat use t his license. When you go t o t he phot o det ail page, you will find t he specific licensing t erm s in t he right hand navigat ion bar. Click on t he " Som e right s reserved" link t o find out what exact ly you can and can't do wit h t he work.

    Se a r ch in g for Cr e a t ive Com m on s– lice n se d ph ot os on Flick r

    For inst ance, if t he phot o has a " share alike" condit ion, t hen you m ust also license your present at ion under t he sam e or sim ilar Creat ive Com m ons license; if you're com fort able wit h t hose t erm s, go t o ht t p: / / creat ivecom m ons.org/ license/ t o pick a com pat ible license. I t 's nice t o share and m ay even give your present at ion addit ional exposure. I f t he phot o has an " at t ribut ion" condit ion, t hen you m ust credit t he phot ographer. Pay at t ent ion t o t he various com binat ions of Creat ive Com m ons license t erm s. For exam ple, " At t ribut ion- NoDerivs" allows you t o reuse t he phot o, but it does not allow you t o creat e derivat ive works from it . Not e t hat when including an im age from t he Web in your present at ion, you m ay need t o open it in an im age edit or, and save in a lower resolut ion or lower qualit y form at so t hat your present at ion doesn't t ake a long t im e t o load [ Hack # 32] .

    H a ck 3 2 . Sh r in k You r Pr e se n t a t ion for Ea sy Sh a r in g Don't leave it t o Google t o opt im ize t he file size of your present at ion. Whet her you're export ing a present at ion t o send t o som eone, or sharing a Google Docs present at ion URL online, it m akes sense t o opt im ize t he size of t he file, so t hat you can reduce t he am ount of t im e it t akes t o download or view your present at ion. The m ost frequent cause of bloat ed present at ion file sizes are large im ages. They m ay also slow you down when you're edit ing your present at ion—t he sam e is t rue for Google docum ent s, t oo.

    N OTE I f you are a user of Adobe Phot oshop or t he free GI MP (ht t p: / / www.gim p.org) graphics edit or, you can use t he Save for Web feat ure t o save files in a nice com pact form at t hat also looks good online. Save for Web perform all of t he st eps described in t his hack. I n Phot oshop, choose File Save for Web. I n GI MP, you'll need t o download and inst all t he Save for Web plugin from ht t p: / / regist ry.gim p.org/ node/ 33 before you can use GI MP's File Save for Web opt ion.

    A phot ograph t hat you've t aken or an im age you've downloaded from t he Web [ Hack # 31] m ay be t oo large t o be efficient ly em bedded in a web page. Alt hough you can resize t he im age wit hin t he present at ion, Google st ill st ores t he original file in it s original size, which m eans t hat t he person viewing your present at ion is downloading t he full im age file. I nst ead, when using large files, it 's bet t er t o load t he im age file int o your favorit e im age edit or and export it using opt im ized set t ings; t ry t o find t he best im age t ype and com pression m et hod, reduce t he im age resolut ion, and ( for cert ain im age form at s) reduce t he num ber of colors. Fin d t h e Opt im u m I m a ge Type a n d Com pr e ssion Qu a lit y

    Ph ot os a r e oft e n be st sa ve d a s JPEGs

    There are m any im age form at s you can choose from . The JPEG form at is good for phot os and cert ain im ages wit h com plex m ult icolor shapes, as shown in Figure 4- 5. Your phot o edit or m ay offer you different qualit y set t ings for saving, so choose t he lowest qualit y t hat you're com fort able wit h; don't go t oo low on t he qualit y, or your phot o will cont ain t he kind of heavy JPEG art ifact s shown in Figure 4- 6. Not e t hat if your source file already cont ains heavy JPEG noise, you cannot rem ove it by j ust resaving wit h a higher qualit y set t ing.

    N OTE Avoid flat red color areas when saving as JPEG. This part icular im age com pression algorit hm oft en creat es heavy, noisy art ifact s for red.

    Th e JPEG qu a lit y se t t in gs for sa vin g t h is ph ot o w e r e t oo low , cr e a t in g a n u n ple a sa n t e n d r e su lt

    The PN G form at is opt im ized for line art , cert ain t ypes of screenshot s t hat don't cont ain large phot os, and ot her less " com plex" pict ures, as shown in Figure 4- 7. PNG is a so- called lossless com pression form at , so t he im age doesn't lose det ail when it 's saved; JPEG, on t he ot her hand, will t ypically lose a bit of it s qualit y every t im e you save it wit h different com pression set t ings. To bet t er help t he PNG com pression reduce your file size, you can also reduce t he num ber of colors in your im age t o 256 ( also known as 8- bit ) . Your im age edit ing program should allow you t o do t his. GI F is a bit of an older form at , sim ilar t o PNG files; here, t he reduct ion t o 256 colors—or 16 colors, or 2—is a m ust . I n m ost circum st ances, you should choose PNG over GI F. GI F allows only a single t ransparent color from t he palet t e, whereas PNG support s varying ranges of t ransparency.

    Scr e e n sh ot s oft e n fa r e w e ll w h e n sa ve d a s PN Gs

    I f in doubt about which im age t ype t o choose, t ry going for PNG first and check whet her t he im age file size is accept able; if t he im age ends up below 40 KB, for inst ance, t his will do fine for m ost purposes. I f t he PNG ends up being t oo large, t ry t o save as JPEG inst ead and com pare file sizes.

    N OTE Som e of Google's present at ion t hem es use background im ages, like t he Grass or Rust ic t hem es. Alt hough t hese im ages aren't dram at ically big, if you want t o fine- t une your present at ion for best perform ance, you can also use a t hem e t hat doesn't use a background im age.

    Good Re sizin g a n d Color Re du ct ion There are different ways t o resize an im age, and t o reduce it s colors ( useful for t he PNG and GI F form at s) . Not e t hat t he t erm inology for t hese varies from one im age edit or t o t he next , but t he underlying approaches are sim ilar . Re sizin g ve r su s r e sa m plin g: Som et im es when downsizing t he resolut ion of a phot o, you are offered t o resize it , or t o resam ple it . Resam pling ret urns sm oot her result s, as it " m erges" t he colors of adj acent pixels. I t m ay only be offered in your phot o edit or if t he im age you are working on uses m ore t han 256 colors; convert your im age t o a high- color form at first if t hat 's not t he case. Aft er resam pling, you can decrease t he am ount of colors again before saving.

    D it h e r in g ve r su s n on dit h e r e d: When you reduce t he num ber of colors for an im age, your phot o ret ouching applicat ion m ay offer you different m et hods for t his. One of t hem is called dit hering or error diffusion. This m eans t hat a " color spray" effect is used t o creat e t he im pression of a higher color range. For inst ance, if you want ed t o convert an im age wit h a high range of gray t ones t o a black and whit e im age, int erm ingling black and whit e pixels could be used t o creat e t he im pression of different t ones of gray, as shown in Figure 4- 8. Alt hough in general, dit hering creat es sm oot her result s, it can also be det rim ent al t o t he file size, as PNG and GI F com pression algorit hm s are bet t er at opt im izing larger sam e- color areas.

    A t w o- color im a ge ca n u se dit h e r in g t o e m u la t e gr a y a r e a s

    H a ck 3 3 . Use Pow e r Poin t Te m pla t e s Load a present at ion t em plat e int o Google Docs. And don't t ake t he wrong file ext ension for a " no." When you export a present at ion, you can t weak t he im ages and st ylesheet s t o fit your needs [ Hack # 30] . But if you have a PowerPoint t em plat e t hat you want t o use ( or if you find one online) , t here's a way t o im port t hose int o Google Present at ions. To find a t hem e, search t he Web for keywords such as powerpoint t hem es or powerpoint t em plat es. For exam ple, one sit e t hat popped up during m y search was ht t p: / / brainybet t y.com / MENUPowerPoint .ht m , which offers free ZI P files of Microsoft PowerPoint present at ion t em plat es. Aft er I downloaded and unzipped t hem , I found t hat t hey cont ained files wit h t he .pot ext ension ( like BusinessI I I .pot ) . Google Present at ions doesn't officially support PowerPoint t em plat es, but if you m ake it t hink t hat t he file is a PowerPoint docum ent , you can get it t o load. Change t he file's .pot ( PowerPoint Tem plat e) ext ension t o .ppt ( PowerPoint Docum ent ) , open up Google Docs, and click t he Upload but t on. Browse for your .ppt file, hit Upload File, and wait a bit . Your present at ion will now consist of t wo or so slides, and you can m ult iply any slide by right - clicking a slide t hum bnail and select ing " Duplicat e slide" from t he cont ext m enu, as shown in Figure 4- 9.

    N OTE I f you have Microsoft PowerPoint or OpenOffice.org available on your local com put er, you can creat e a new blank present at ion, pick a t em plat e of your choosing, and t hen save t he docum ent as a .ppt . Then you can im port it int o Google Present at ions.

    A Pow e r Poin t t e m pla t e fr om Br a in yBe t t y.com im por t e d in t o Google Pr e se n t a t ion s

    H a ck 3 4 . Vie w You r Pr e se n t a t ion on a M obile Ph on e Want t o t ake a present at ion wit h you? As of t his writ ing, Google did not offer a way t o view present at ions on a m obile phone. However, m any m obile devices, especially so- called " sm art phones," can view PDF files. I f you've got a m obile device t hat support s PDF, you can generat e a PDF version of your present at ion by select ing File Export as PDF, and t hen send t he PDF t o your phone using Bluet oot h, t he synchronizat ion soft ware t hat cam e wit h your phone, or by put t ing it on t he phone's m em ory card. Figure 4- 10 shows a Google Present at ion PDF on a Nokia Series 60 m obile phone. There is at least one m obile device t hat can view PDFs, but which has no user- accessible file st orage: t he iPhone. To view a PDF on t he iPhone, you can eit her post t he PDF on a web sit e t hat you lat er access wit h your iPhone's web browser, or em ail it t o one of t he em ail account s you can read on your iPhone. I f your m obile device does not support PDF, you m ay st ill be able t o view it . The pdft oht m l ut ilit y ( see ht t p: / / pdft oht m l.sourceforge.net) can convert PDF files t o HTML. This ut ilit y will t urn a PDF int o a collect ion of HTML and im age files t hat you can t ransfer t o a web server and view from any HTML- capable device. You'll need t o experim ent wit h pdft oht m l's set t ings t o opt im ize t he generat ed HTML t o fit t he capabilit ies of your m obile device. — Brian Jepson

    Vie w in g a pr e se n t a t ion on t h e go ( t h e 3 4 % in dica t e s t h e docu m e n t sca le )

    H a ck 3 5 . M a k e You r Pr e se n t a t ion s Ea sy t o Re a d Enhance t he accessibilit y and readabilit y of your present at ion. The World Wide Web is far from WYSI WYG—what you see is usually not what you get . What you see on your browser is only one rendering of t he m any possible ways a web page m ay appear t o users. This flexibilit y isn't necessarily a bad t hing, as it allows HTML t o be convert ed t o speech, t o fit on sm all m obile screens, be spidered by search bot s, or be rendered by nongraphical browsers. I t also allows t he reader of a docum ent t o m ake changes in t heir browser opt ions t o adj ust t he docum ent —for exam ple, a sight - im paired person m ight want t o increase t he docum ent font size. Cat ering for all t hese kinds of devices and user needs is called accessibilit y . Accessibilit y in part depends on t he t ools you use t o generat e t he HTML. I n t he case of Google Present at ions, you don't cont rol t he HTML during creat ion—it 's possible t hat t he present at ion as generat ed by Google j ust won't adj ust t o a m obile phone display, for inst ance. However, you can st ill ensure t hat you use cert ain font s, colors, and ot her design elem ent s so t hat t he present at ion is clearly decipherable when viewed. Here are som e t ips t o help you achieve t his. N ot e t h a t som e fon t s m a y n ot be in st a lle d on t h e t a r ge t syst e m . As HTML t ypically doesn't em bed font s for viewing, t he browser t ries t o find t he font on t he local syst em . I f it 's not t here, it picks anot her font . At t he t im e of t his writ ing, Present at ions allow you t o choose from t he font s Arial ( called " Norm al" ) , Courier New, Georgia, Trebuchet , and Verdana. As t hese are rat her com m on font s, you should be generally safe wit h t hose. ( And even if a fallback font is displayed on anot her browser, it 's not t he worst t hing t hat could happen, alt hough it can som et im es lead t o st range overlapping bet ween lines of t ext .) Know t hough t hat som e charact ers you m ay be using, like Chinese charact ers or special sym bols [ Hack # 12] , m ay not be inst alled on t he t arget syst em . Ch oose a h igh - con t r a st color sch e m e . When your present at ion is proj ect ed on a screen, it m ight becom e bright er, look washed- out , or lose som e colors. A form erly perfect ly t uned, subt le color schem e can suddenly becom e unreadable. To prepare for t his in advance, use st rong cont rast s. For exam ple, bright yellow t ext on a whit e background should be avoided, whereas black on whit e will always work. Som e of t he t hem es offered by Present at ions, like t he one nam ed Bubbles, are already borderline in t his regard. You should also m ake sure t he line weight s on your font s are heavy enough t o st and out well ( font s wit h t hin weight s t end t o get lost ) . Con side r dow n loa d t im e s for you r a u die n ce . Google Present at ions are web pages, so t hey need t o be downloaded t o t he browser before t hey are displayed. To creat e fast - loading present at ions, t ry not t o include giant im ages. Som et im es, choosing t he right im age file t ype, com pressing t he im ages, and reducing t he num ber colors can go a long way t oward im proving download speed [ Hack # 32] . Tr y n ot t o con ve y in for m a t ion by color a lon e . I f you use colors t o m ake a point , it m akes som e sense t o also include t he relevant inform at ion in anot her way, as color blind people m ay have difficult y wit h t he com binat ions of colors you have select ed. For inst ance, if you display a graph t hat dist inguishes it em s using color, you should also use a secondary cue, such as pat t erns or t hickness.

    N OTE The Trace Research and Developm ent Cent er includes links t o sit es and t ools t hat will help you adapt your color schem e choices for color blind users. See ht t p: / / t race.wisc.edu/ world/ web/ # dis_web_use.

    I f w r it in g for a globa l a u die n ce , don 't e x pe ct a fu ll gr a sp of t h e En glish la n gu a ge . This is m ore about readabilit y t han accessibilit y: using sim pler wording can som et im es allow your readers t o get your point quickly, as t hey won't need t o look t hings up in a dict ionary. ( A t hesaurus, like t he one found at ht t p: / / t hesaurus.com , com es in handy when looking for sim pler word alt ernat ives.) Grant ed, som et im es a m ore exot ic word j ust get s

    t he point across m ore elegant ly, and m ay be t he best choice . . . and even m em bers of a foreign audience m ight be int erest ed in learning new words. Oft en, a balance bet ween t he t wo approaches can achieve good result s.

    H a ck 3 6 . Em be d a Pr e se n t a t ion in You r W e b Pa ge Go sm all wit h your present at ion. I f you have a blog or ot her web sit e, you can eit her point people t o t he present at ion by linking t o it —or, if you want t o m ake t hings quick and easy for your visit ors, j ust em bed t he so- called Mini Present at ion Module. To use it , first m ake sure your present at ion is published. I n Google Present at ions, swit ch t o t he Publish t ab and click " Publish docum ent " ( you can unpublish t he docum ent lat er if you change your m ind) . A box appears wit h an HTML snippet like t he following:

    Copy and past e t his int o t he your blog or web page using t he HTML view of your edit or. I n Figure 4- 11, I 'm using Blogger.com . The result , as shown in Figure 4- 12, is a m iniat ure version of t he present at ion, st yled not unlike t he YouTube video player. Back and forward but t ons allow t he visit or t o go t hrough your slides.

    Pr e pa r in g a blog post in Google 's Blogge r ; n ot e t h a t t h e H TM L sn ippe t n e e ds t o be e n t e r e d in t o t h e Edit H TM L t a b, n ot t h e Com pose t a b of t h e e dit or

    N OTE Not e t hat at t he t im e of t his writ ing, you cannot successfully change t he widt h and height at t ribut es of t he HTML snippet —your m ini present at ion will always rem ain fixed at 410 x 342 resolut ion. I f you care about HTML accessibilit y, include a plain link t o t he published present at ion bet ween t he opening and closing iframe t ags like t his: My presentation. This link let s your readers find your present at ion even if t hey are using a t ool t hat doesn't support inline fram es—say, cert ain RSS feed readers ( t ools and browsers t hat do support ifram es will j ust hide your alt ernat ive link) . And if you care about HTML validat ion, not e t hat you

    need t o m ake sure your HTML docum ent conform s t o t he " t ransit ional" docum ent t ype for t he iframe elem ent t o be valid. To t ry validat ing your sit e, point your browser t o ht t p: / / validat or.w3.org and ent er your sit e's URL. ( Not every error point ed out by t he World Wide Web Consort ium 's validat or will cause t roubles in popular browsers, t hough som e of t he errors m ay do so.)

    Any kind of widget em bedded in your web sit e m ay slow down t he loading t im e of your page; t his includes m ini present at ions. Don't shy away from using widget s, but do t est your sit e every now and t hen, and t ry not t o include t oo m any of t hem .

    Th e r e su lt is a n e m be dde d Google pr e se n t a t ion , w it h a ll im a ge s a n d t e x t sca le d dow n for m in ia t u r e r e a din g

    H a ck 3 7 . D r a g a n d D r op I m a ge s fr om Ot h e r W e b Sit e s I nclude anot her sit e's im ages wit hout saving t hem locally first . This feat ure of Google Present at ions is a bit of a rarit y am ong web applicat ions, so it could easily get lost , alt hough it 's really useful: you can drag and drop im ages from ot her web sit es int o your present at ion, as shown in Figure 4- 13. Just open t wo browser windows side by side, click and hold t he left m ouse but t on on t he pict ure, and drag it int o a blank spot wit hin your present at ion slide. ( Not e t hat t his creat es a copy of t he original im age on Google's servers, so t he original server will not need t o bear t he bandwidt h burden when people view t he im age in your present at ion.)

    D r oppin g t h e Flick r im a ge in t o t h e slide

    I f you plan t o publish your present at ion, m ake sure you are wit hin your right s t o use t he im age: eit her ensure t hat you are working wit hin t he principles of Fair Use ( web sit es such as ht t p: / / copyright .gov/ fls/ fl102.ht m l and ht t p: / / fairuse.st anford.edu have ext ensive inform at ion on Fair Use) or choose an im age t hat has a license perm it t ing you t o share it [ Hack # 31] . For inst ance, t he phot o I 'm using in t he figure is by Hildo Trazo, who was nice enough t o release it under a Creat ive Com m ons At t ribut ion license. The license requires m e t o add t he necessary credit s wit hin t he present at ion before publishing it .

    N OTE The im age file size will rem ain t he sam e as t he source file, even if you resize t he im age wit hin your present at ion, so you m ay be bet t er off saving it locally first and resizing it [ Hack # 32] .

    H a ck 3 8 . Sa ve You r Pr e se n t a t ion s a s Vide o I f a pict ure t ells a t housand words, a video t ells a m illion. When you convert your present at ion t o a video, you can upload it t o sit es like YouTube for easy em bedding and viewing. A video present at ion also allows you t o add sound such as m usic and voiceovers. But how do you go from a web page ( rem em ber, every Google present at ion is essent ially a web page) t o video form at ? Windows Movie Maker is a free program by Microsoft t hat let s you creat e videos. I t 's included wit h Windows XP and Vist a ( St art All Program s Windows Movie Maker) . You can cut t he video, add sound, use subt it les, and m ore. Sim ilarly, Mac OS X has iMovie, inst alled by default on every Mac ( for a quick and easy slideshow, iPhot o will do t he t rick) . Whet her you're on Mac OS X or Windows, you need t o t urn your present at ion int o a Save as sequence of im ages before you can m ake a m ovie. There are t wo ways t o do t his. But first , use File PDF t o get a PDF of your present at ion. Br e a k a Pr e se n t a t ion u p I n t o I m a ge s Usin g Scr e e n sh ot s Using an im age edit or—like Phot oshop, Phot oPaint , Paint Shop Pro, or t he GI MP—you can t ake screenshot s from t he PDF view of t he present at ion. On Windows, you can m ake a screenshot of each PDF page by pressing t he Prt Scrn but t on t o put t he ent ire screen int o your clipboard. Then, past e t he screenshot int o your im age edit or. I n your im age edit or, crop t he screenshot t o t he exact size of t he slide, as shown in Figure 4- 14. Save each slide as 1.png , 2.png , 3.png and so on. On Mac OS X, press Com m and- Shift - 4, and t he m ouse cursor will t urn int o a crosshair. Click and drag t o select a slide, and Mac OS X deposit s a screenshot on your deskt op nam ed Pict ure 1.png. Repeat for each slide, and you'll have Pict ure 2.png, Pict ure 3.png, and so on. Br e a k a Pr e se n t a t ion I n t o I m a ge s Usin g I m a ge M a gick I m ageMagick is an open source suit e of im age m anipulat ion t ools t hat let you convert , crop, and st yle im ages—and t hat 's nam ing j ust a few of it s capabilit ies. You can also use I m ageMagick t o t urn a PDF int o a sequence of im ages. Go t o ht t p: / / www.im agem agick.org t o download and inst all t he version of I m ageMagick for your operat ing syst em . To use I m ageMagick, you need t o get yourself t o a com m and line prom pt . On Windows, t his is called t he Com m and Prom pt , and can be found via t he St art m enu ( or you can press Windows- R, t ype cmd, and t hen press Ent er) . On Mac OS X, open t he Finder, m ake your way t o t he Applicat ions direct ory, and t hen int o t he Ut ilit ies direct ory under t hat . Run t he Term inal program . Now you need t o cd ( change direct ory) t o where your PDF is. Assum ing it 's on your deskt op, here's what you t ype t o do it on Windows: %HOMEDRIVE%%HOMEPATH%\Desktop

    Ge n e r a t in g in dividu a l slide sh ow im a ge s

    On Mac OS X, t ype: cd ~/Desktop

    Now, you need t o run t he convert com m and on your PDF. A %d in t he out put filenam e t ells I m ageMagick t o generat e a series of num bered im ages. You'll need t o replace " All About Tea.pdf" wit h t he nam e of your PDF: convert "All About Tea.pdf" slide_%d.png

    Windows has it s own com m and- line ut ilit y nam ed convert . I f you've inst alled I m ageMagick, it should have set t hings up so you run it s convert ut ilit y inst ead of t he Windows one. I f you need t o run t he Windows convert ut ilit y, t ry t he com m and %SYSTEMROOT%\SYSTEM32\convert /?. I f you find t hat t he Windows convert ut ilit y is running inst ead of I m ageMagick's, t ry "C:\Program Files\ImageMagick-6.3.8Q16\convert.exe". ( The exact nam e of t he I m ageMagick direct ory m ay be different depending on which version you inst alled.)

    When you're done, you'll have a series of im ages on your Deskt op: slide 1 will be nam ed slide_0.png, slide 2 will be nam ed slide_1.png, and so fort h. Now you are ready t o drop your im ages int o t he m ovie.

    N OTE Alt ernat ively, if you'd like an anim at ed GI F, I m ageMagick would be happy t o oblige. Specify a GI F as t he out put filenam e wit hout t he %d, and specify a delay in seconds, as in: convert -delay 5 "All About Tea.pdf" "All About Tea.gif".

    M a k in g t h e M ovie Aft er com plet ing t he previous st eps, run Windows Movie Maker ( Windows) or iPhot o ( Mac OS X) . I f Movie Maker is not on your Windows com put er already, point your browser t o ht t p: / / m icrosoft .com / windowsxp/ downloads/ updat es/ m oviem aker2.m spx t o find out m ore about how t o get it . Aft er st art ing Movie Maker or iPhot o, you can select all of your individual PNG im ages at once and drag and drop t hem int o t he program . I f you're using Windows Movie Maker, you should first adj ust t he present at ion speed by going t o Tools Opt ions Advanced and set t ing t he pict ure durat ion. Arrange t he im ages on t he st oryboard as shown in Figure 4- 15. You can give t he video a t est drive now and add t it les, subt it les, effect s, im age t ransit ions and sound, and t hen save it by choosing File Save Movie File. The generat ed video form at is WMV, short for Windows Media Video, which is also support ed as an upload form at on Google's YouTube.com .

    N OTE When you want t o upload your present at ion clip t o a video sharing sit e, it is advisable t hat you use t he highest qualit y export set t ings in Movie Maker, as YouTube and ot hers will com press t he video t o a sm aller file size lat er anyway.

    Th e slide sh ow im a ge s a r e n ow im por t e d t o W in dow s M ovie M a k e r

    On Mac OS X, select t he im ages in iPhot o, choose File Export , and t hen pick QuickTim e. Choose t he desired opt ions ( including background m usic, im age size, and how long t o display each im age) as shown in Figure 4- 16, and click Export .

    N OTE You can record your own voice t o add as a sound layer for t he present at ion, which will enable you t o

    guide t he viewer t hrough t he slides. Or, if you want t o add m usic but you don't have anyt ing appropriat e on your com put er, you can search Google for keywords like royalty-free music, dramatic music, public domain mp3s, creative commons music and so on ( m ake sure t hat t he m usic you find is indeed royalt y- free) . I f you want t o add sound t o your present at ion on Mac OS X, im port your slideshow video int o iMovie first . iMovie has m any m ore opt ions t han iPhot o.

    — Brian Jepson and Philipp Lenssen

    Ex por t in g slide sh ow im a ge s t o a vide o on M a c OS X

    BECOM E A GM AI L POW ER USER Gm a il—a lso ca lle d Google M a il in cou n t r ie s w h e r e t h e r e w e r e t r a de m a r k issu e s w it h t h e n a m e " Gm a il" —is Google 's w e b- ba se d e m a il clie n t , a s pict u r e d in Figu r e 5 - 1 . As w it h m a n y ot h e r Google se r vice s, it 's fr e e t o u se , bu t com e s w it h con t e x t - se n sit ive a dve r t ise m e n t s in som e pla ce s. Gm ail m ade quit e a splash when it arrived on t he scene on April 1, 2004, not only because of it s t hen 1 GB of st orage, which m any people first believed was an April Fool's hoax ( Microsoft 's Hot m ail, in com parison, had only 2 MB at t he t im e) , but also because t he int erface reinvent ed som e aspect s of what we usually expect from em ail client s. Today, Gm ail has:

    WHAT'S WI TH ALL THESE ADS? Gm ail displays advert isem ent s t hat are t arget ed t o your em ails. This m eans t hat when you or your friends t alk about , say, indoor sundials ( a special device ut ilizing a rot at ing lam p t o show t he t im e even when t he sun's not shining! ) , t he advert isem ent next t o t he m essage m ay read " Buy cheap indoor sundials" wit h a link t o t he sponsor. When Gm ail was launched, t his st irred up som e cont roversy because people realized t hat Google's m achines would read t heir em ail in order t o t arget t he ads. The t rut h is, all web- based em ail client s m ust access your m ail cont ent in order t o st ore, process and display it , but Google decided t o display t arget ed inst ead of unt arget ed ads. The rule of t hum b is: as em ail m ay cont ain a lot of privat e inform at ion on you and your friends, only use em ail client s from com panies which you t rust t o handle t his inform at ion wit h care. This is t rue for Gm ail, Windows Live Mail, Yahoo! Mail and even em ail t hat 's not web- based: em ail m essages t hat are sent and received m ust pass t hrough an em ail server t hat 's under t he cont rol of whom ever provides you wit h em ail service.

    A conversat ion view t hat sort s replies t o your m ails int o a singsle t hread.

    Built - in chat funct ionalit y, allowing you t o swit ch bet ween em ail and Google Chat .

    An inbox t hat inst ant ly displays aft er signing in ( ot her em ail client s oft en show t he inbox only aft er an ext ra click) .

    Labels inst ead of folders, m eaning t hat you can at t ach m ult iple keywords t o a single em ail.

    An expandable st orage plan, where you can buy som e ext ra gigabyt es if in need ( and share t he ext ra st orage wit h ot her Google applicat ions, t oo) .

    A search funct ion t hat ret urns result s wit hin split - seconds. Paul Buchheit , one of t he invent ors of Gm ail, said " Everyone here [ at Google] had lot s of em ail. This com pany is a lit t le bit em ail crazy. I get 500 em ails a day. So t here was a very big need for search." [ ]

    []

    Founders at Work, Jessica Livingst on ( Apress, 2007) .

    While Gm ail can do a lot already, people expanded it over t im e wit h hom em ade t ools and t ricks. One popular approach is t o use Greasem onkey script s. A Greasem onkey script expands your Firefox browser t o get a web page t o do m ore t han it s m akers int ended it t o do [ Hack # 42] . You can also hack Gm ail by adding a user st ylesheet [ Hack # 41] . And t here's an abundance of advanced nat ive feat ures t hat you can use, like t he Gm ail search operat ors [ Hack # 44] —useful even if you get fewer t han 500 m ails a day—and t hird- part y t ools t hat connect t o Gm ail [ Hack # 45] . To sign up for Gm ail and get an address in t he form of j anedoe@gm ail.com , go t o ht t p: / / gm ail.com and log in wit h your Google Account ( see Chapt er 1 ) . Figure 5- 1 shows a Gm ail inbox.

    Th e Gm a il in box , cu r r e n t ly u sin g 0 % of t h e a va ila ble 2 8 8 8 M B.

    H a ck 3 9 . Se n d M a il t o Se ve r a l Pe ople a t On ce Do you find yourself addressing t he sam e group of recipient s over and over? I t can be quit e m onot onous t o ent er all t heir em ail addresses every t im e. There is an easier way t o achieve t his. I f you haven't got t en around t o checking out t he Cont act s funct ionalit y in Gm ail, have a look by clicking on t he left hand " Cont act s" link in Gm ail. You will now see a list of your cont act s wit h whom you exchange m ail frequent ly, as well as a com plet e list of cont act s, and your cont act groups. For every cont act , you can provide address or t elephone det ails, along wit h ot her privat e not es on t he cont act . You can also add a sm all phot o for every cont act , or add a cont act group. Creat ing your own cont act group has one m aj or advant age: you will t hen be able t o j ust t ype t he group nam e in t he Gm ail To: field, and see it expand t o t he full list of recipient s. Not only will t his save you t im e t yping, it also decreases t he chance t hat you'll accident ally address t he wrong person ( sending pot ent ially privat e inform at ion) because t wo of your cont act s share t he sam e first nam e. To creat e a new group, swit ch t o t he Cont act s dialog. Click t he but t on wit h a plus sign and t wo people at t he t op of t his box t o add a group ( see Figure 5- 2) . Nam e t he group—like " Fam ily" or " Colleagues." Then, select " All Cont act s" again, and place a check m ark next t o t hose you want in t he group. Click on t he Groups but t on, and select your new group from t he drop- down " Add t o ..." list . Now, when you com pose a new m essage by clicking Com pose Mail or hit t ing c [ Hack # 46] , you can j ust ent er t he first let t ers of t he group nam e and hit Ret urn or Tab t o expand t he nam e t o all em ail addresses of t his group aut om at ically as shown in Figure 5- 3.

    Addin g a Gm a il con t a ct gr ou p

    Gm a il's a u t ocom ple t ion fe a t u r e in a ct ion

    BECOM E A GM AI L POW ER USER Gm a il—a lso ca lle d Google M a il in cou n t r ie s w h e r e t h e r e w e r e t r a de m a r k issu e s w it h t h e n a m e " Gm a il" —is Google 's w e b- ba se d e m a il clie n t , a s pict u r e d in Figu r e 5 - 1 . As w it h m a n y ot h e r Google se r vice s, it 's fr e e t o u se , bu t com e s w it h con t e x t - se n sit ive a dve r t ise m e n t s in som e pla ce s. Gm ail m ade quit e a splash when it arrived on t he scene on April 1, 2004, not only because of it s t hen 1 GB of st orage, which m any people first believed was an April Fool's hoax ( Microsoft 's Hot m ail, in com parison, had only 2 MB at t he t im e) , but also because t he int erface reinvent ed som e aspect s of what we usually expect from em ail client s. Today, Gm ail has:

    WHAT'S WI TH ALL THESE ADS? Gm ail displays advert isem ent s t hat are t arget ed t o your em ails. This m eans t hat when you or your friends t alk about , say, indoor sundials ( a special device ut ilizing a rot at ing lam p t o show t he t im e even when t he sun's not shining! ) , t he advert isem ent next t o t he m essage m ay read " Buy cheap indoor sundials" wit h a link t o t he sponsor. When Gm ail was launched, t his st irred up som e cont roversy because people realized t hat Google's m achines would read t heir em ail in order t o t arget t he ads. The t rut h is, all web- based em ail client s m ust access your m ail cont ent in order t o st ore, process and display it , but Google decided t o display t arget ed inst ead of unt arget ed ads. The rule of t hum b is: as em ail m ay cont ain a lot of privat e inform at ion on you and your friends, only use em ail client s from com panies which you t rust t o handle t his inform at ion wit h care. This is t rue for Gm ail, Windows Live Mail, Yahoo! Mail and even em ail t hat 's not web- based: em ail m essages t hat are sent and received m ust pass t hrough an em ail server t hat 's under t he cont rol of whom ever provides you wit h em ail service.

    A conversat ion view t hat sort s replies t o your m ails int o a singsle t hread.

    Built - in chat funct ionalit y, allowing you t o swit ch bet ween em ail and Google Chat .

    An inbox t hat inst ant ly displays aft er signing in ( ot her em ail client s oft en show t he inbox only aft er an ext ra click) .

    Labels inst ead of folders, m eaning t hat you can at t ach m ult iple keywords t o a single em ail.

    An expandable st orage plan, where you can buy som e ext ra gigabyt es if in need ( and share t he ext ra st orage wit h ot her Google applicat ions, t oo) .

    A search funct ion t hat ret urns result s wit hin split - seconds. Paul Buchheit , one of t he invent ors of Gm ail, said " Everyone here [ at Google] had lot s of em ail. This com pany is a lit t le bit em ail crazy. I get 500 em ails a day. So t here was a very big need for search." [ ]

    []

    Founders at Work, Jessica Livingst on ( Apress, 2007) .

    While Gm ail can do a lot already, people expanded it over t im e wit h hom em ade t ools and t ricks. One popular approach is t o use Greasem onkey script s. A Greasem onkey script expands your Firefox browser t o get a web page t o do m ore t han it s m akers int ended it t o do [ Hack # 42] . You can also hack Gm ail by adding a user st ylesheet [ Hack # 41] . And t here's an abundance of advanced nat ive feat ures t hat you can use, like t he Gm ail search operat ors [ Hack # 44] —useful even if you get fewer t han 500 m ails a day—and t hird- part y t ools t hat connect t o Gm ail [ Hack # 45] . To sign up for Gm ail and get an address in t he form of j anedoe@gm ail.com , go t o ht t p: / / gm ail.com and log in wit h your Google Account ( see Chapt er 1 ) . Figure 5- 1 shows a Gm ail inbox.

    Th e Gm a il in box , cu r r e n t ly u sin g 0 % of t h e a va ila ble 2 8 8 8 M B.

    H a ck 3 9 . Se n d M a il t o Se ve r a l Pe ople a t On ce Do you find yourself addressing t he sam e group of recipient s over and over? I t can be quit e m onot onous t o ent er all t heir em ail addresses every t im e. There is an easier way t o achieve t his. I f you haven't got t en around t o checking out t he Cont act s funct ionalit y in Gm ail, have a look by clicking on t he left hand " Cont act s" link in Gm ail. You will now see a list of your cont act s wit h whom you exchange m ail frequent ly, as well as a com plet e list of cont act s, and your cont act groups. For every cont act , you can provide address or t elephone det ails, along wit h ot her privat e not es on t he cont act . You can also add a sm all phot o for every cont act , or add a cont act group. Creat ing your own cont act group has one m aj or advant age: you will t hen be able t o j ust t ype t he group nam e in t he Gm ail To: field, and see it expand t o t he full list of recipient s. Not only will t his save you t im e t yping, it also decreases t he chance t hat you'll accident ally address t he wrong person ( sending pot ent ially privat e inform at ion) because t wo of your cont act s share t he sam e first nam e. To creat e a new group, swit ch t o t he Cont act s dialog. Click t he but t on wit h a plus sign and t wo people at t he t op of t his box t o add a group ( see Figure 5- 2) . Nam e t he group—like " Fam ily" or " Colleagues." Then, select " All Cont act s" again, and place a check m ark next t o t hose you want in t he group. Click on t he Groups but t on, and select your new group from t he drop- down " Add t o ..." list . Now, when you com pose a new m essage by clicking Com pose Mail or hit t ing c [ Hack # 46] , you can j ust ent er t he first let t ers of t he group nam e and hit Ret urn or Tab t o expand t he nam e t o all em ail addresses of t his group aut om at ically as shown in Figure 5- 3.

    Addin g a Gm a il con t a ct gr ou p

    Gm a il's a u t ocom ple t ion fe a t u r e in a ct ion

    H a ck 4 0 . I m por t Con t a ct s fr om Ot h e r Em a il Pr ogr a m s I f you m oved from anot her em ail client t o Gm ail, you lost all of your exist ing cont act addresses. Or did you? Gm ail allows you t o im port and export your cont act dat a. The file form at for t his is a com m a- separat ed values ( CSV) file. To im port a CSV file, log in t o Gm ail and click t he Cont act s link t o t he left . Now click I m port ( at t he t im e of t his writ ing, locat ed at t he bot t om of t he screen) , click Browse t o select your CSV file, and click I m port . But how do you get Out look Express, Hot m ail, Thunderbird, or Mac OS X Mail t o creat e such a file for you? Here is how t o do it in t hese program s; ot her em ail client s have sim ilar export opt ions. Ou t look Ex pr e ss I n Out look Express, choose File Export Address Book. . . from t he m enu, as shown in Figure 5- 4. I n t he dialog t hat follows, select " Text File ( Com m a Separat ed Values) " and click t he Export but t on. Choose a locat ion for t he CSV file and select t he fields you want t o export , or j ust leave t hese checkboxes on t heir default select ion. I f you are curious, t his is what t he saved CSV file m ay look like if you were t o open it in a sim ple t ext edit or ( wit h som e of t he m any fields snipped for brevit y) : Name,E-mail Address,Home Street,Home City,Home Postal Code,... Frank Smith,[email protected],,London,,... Daniel Clowes,[email protected],,Oakland,,... Jaime Hernandez,[email protected],,,... ...

    As you can see, t he first line cont ains t he field nam es, and t he ot her lines cont ain t he field values in sequent ial order. You can also open a file like t his in Excel, Google Spreadsheet s, or any ot her program support ing CSV.

    Ex por t in g a n a ddr e ss book in Ou t look Ex pr e ss

    To im port t his file int o Gm ail, open Gm ail and choose Cont act s I m port , as shown in Figure 5- 5. Not e t hat aft er a successful im port , you m ay need t o swit ch from " Most Cont act ed" t o " All Cont act s" t o see t he new

    cont act s ( and t o furt her edit t hem in Gm ail, as you see fit ) . H ot m a il I f you have signed up wit h Windows Live Hot m ail but you want t o swit ch t o Gm ail, you can t ake your address book wit h you as well. St art by logging in t o Hot m ail.com . Click t he Cont act s but t on t o t he left side, and t hen Export cont act s from t he t op- right m enu. Click t he " Export cont act s" but t on t o st art t he file choose Opt ions I m port from wit hin download. Save t he CSV file som ewhere, and im port it int o Gm ail by choosing Cont act s Gm ail.

    I m por t in g t h e a ddr e ss book in t o Gm a il

    M ozilla Th u n de r bir d I f you are using Thunderbird as your m ail client , you can export your cont act s by opening up t he address book and select ing Tools Export from t he m enu, as shown in Figure 5- 6. I n t he save dialog, choose Com m a Separat ed as file t ype. Pick any file nam e, like " cont act s" , and save. Open t he saved file by choosing Cont act s I m port in Gm ail. M a c OS X Addr e ss Book I f you use Apple's Mail program , all your cont act s are probably in Apple's Address Book applicat ion, which cannot export CSV on it s own. However, t he free A t o G ut ilit y, available at ht t p: / / bborofka.com / at og/ , can do t his for you.

    Ex por t in g Th u n de r bir d's a ddr e ss book

    H a ck 4 1 . Adj u st You r Gm a il La you t By adding a user st ylesheet t o your browser, you can t weak t he design of any web page, including Gm ail.com . The default Gm ail layout is already good, but you m ight want t o adj ust som e det ails t o im prove on it . For inst ance, you m ight t hink t he font size of m essages is t oo sm all t o com fort ably read. One t hing you can do is press Ct rl- + ( Com m and- + on t he Macint osh) in your browser ( t his works in I nt ernet Explorer 7 or Firefox 2, am ong ot hers) . But , depending on your browser, t his t echnique m ay also change ot her web pages t hat you read. Anot her approach t o t weak t he Gm ail layout is t o add a user st ylesheet . St ylesheet s—or CSS ( short for " cascading st yle sheet s" ) —com e in t wo flavors: user st ylesheet s and aut hor st ylesheet s. An aut hor st ylesheet is creat ed by t he webm ast er and delivered t o you from t he server. ( I n t heory, t he webm ast er can creat e several aut hor st ylesheet s, one for each m edium —print ed hard copy, m obile devices, com put er screen, and so on.) A user st ylesheet , on t he ot her hand, is st ored locally on your com put er, and can override t he set t ings of t he aut hor st ylesheet . Toget her, t he t wo st yles will be m erged int o what you will see displayed in t he browser. Let 's use a sim ple st ylesheet t hat will t urn t he background of every web page ( not j ust Gm ail) gray: body { background-color: gray !important; }

    The CSS synt ax is always writ t en in t he order select or ( body) , pr oper t y(background-color) , and value ( gray) . The important keyword j ust m akes sure t he aut hor st ylesheet delivered by t he server is overridden. I n t e r n e t Ex plor e r To add a user st ylesheet in I nt ernet Explorer 7, first creat e a new t ext docum ent on your com put er. Use Not epad or your favorit e t ext edit or. Just be sure t o save t he file as plain t ext wit hout any form at t ing. Open it and t ype t he st ylesheet code in t he previous exam ple int o it . Save your file as user.css. Next , select Tools I nt ernet Opt ions General Accessibilit y " Form at docum ent s using m y st yle sheet ." Click Browse t o select your user.css file. To st op using t his st ylesheet , uncheck t he box labeled " Form at docum ent s using m y st yle sheet ."

    N OTE I nt ernet Explorer caches your st ylesheet . You m ay want t o renam e it and reselect t he st ylesheet every t im e you m ake a change t o it , so t hat your lat est CSS is used.

    Fir e fox I n Firefox on Windows XP or Vist a, use a t ext edit or t o creat e ( or if it already exist s, t o edit ) t he file % APPDATA% \ Mozilla\ Firefox\ Profiles\ foldername\ chrom e\ userCont ent .css, add t he CSS t o it , and rest art Firefox. Not e t hat foldername is a random sequence of charact ers followed by .default ( for exam ple, dph0cj 4b.default ) t hat is different for each Firefox user. % APPDATA% is a Windows variable t hat you can t ype int o t he Explorer locat ion bar, t he " File nam e" field in file save/ open dialogs, and t he Com m and Prom pt . I t expands t o t he full pat h of your Applicat ion Dat a folder, such as C: \ Users\ username\ AppDat a\ Roam ing\ . For Firefox on Linux, t he pat h t o your user st ylesheet is usually ~ / .m ozilla/ firefox/ foldernam e/ chrom e/ userCont ent .css.

    For Firefox on Mac OS X, it usually is t he Library/ Applicat ion Support / Firefox/ Profiles/ foldername/ chrom e/ userCont ent .css folder in your hom e folder. To st op using t his st ylesheet , delet e t he lines you added from t he userCont ent .css file, delet e t he file, or m ove it out of t he way ( like int o anot her folder) . For a lit t le m ore luxury in m anaging st ylesheet s in Firefox, you can also download an ext ension called St ylish [ Hack # 72] . To st op using t he st ylesheet , click " None Select ed" on t he St yle Sheet pop- up m enu. Sa fa r i Preferences I f you're using Safari, choose Safari m enu and select t he user.css file t hat you creat ed.

    Advanced. Choose Ot her from t he St yle Sheet pop- up

    Adm it t edly, a gray background on every web page isn't t oo pret t y, but as you can see, your change t ook effect im m ediat ely. For a m ore subt le change of design, you need t o define a m ore precise select or ( t his det erm ines which HTML elem ent s t he new st yling is applied t o) t han j ust body ( which select ed everyt hing) . To do so, open t he HTML source of t he Gm ail page. I n Firefox, you can sim ply select a port ion of t he page, right - click, and select " View select ion source," as shown in Figure 5- 7. At t he t im e of t his writ ing, t he HTML preceding a Gm ail m essage had t he following form at —but as wit h any web page, t his is subj ect t o change over t im e, so you will need t o view t he source of a Gm ail web page t o see exact ly where t hings are t hese days:

    Hello Jane! ...

    I n t he user st ylesheet , you can now specify t he classes highlight ed in t he exam ple t o increase t he font - size: .cbln .mb { font-size: 17px !important; }

    This CSS m eans t hat any elem ent of t he class mb t hat is nest ed wit hin an elem ent of t he class cbln is select ed, applying a font size of 17 pixels. The use of t he important keyword ensures t hat st yles defined elsewhere are being overruled. The default Gm ail font size, as shown in Figure 5- 8, will now be increased for you, as shown in Figure 5- 9. You m ight also want t o t weak t he font size t o a relat ive font size: " 95% " will m ake t he font 95% t he size of t he default .

    Se le ct in g a por t ion of t h e pa ge t o vie w t h e sou r ce H TM L be h in d it

    Gm a il a t it s de fa u lt fon t size

    Gm a il w it h a n in cr e a se d fon t size a ft e r a pplyin g a u se r st yle sh e e t

    H a ck 4 2 . Ch a n ge t h e Appe a r a n ce a n d Be h a vior of Gm a il Gm ail already has plent y of opt ions. But wit h t his hack, you can add plent y m ore. Greasem onkey is a Firefox browser ext ension t hat allows anyone t o provide code t hat adds som e bells and whist les t o web applicat ions—including Gm ail. I f you've ever felt like you hit t he lim it s of Gm ail's nat ive funct ionalit y, you m ight want t o give Greasem onkey a t ry. To inst all t his add- on, point your Firefox browser t o ht t p: / / greasespot .net and click t he " Download Greasem onkey" link. Select t he I nst all Now but t on t o be guided t hrough t he inst allat ion process. Aft er rest art ing your browser, Greasem onkey is now act ive for you, indicat ed by a sm iling m onkey icon in t he bot t om right of your browser ( click t he m onkey head at any t im e t o m ake it frown—t his deact ivat es Greasem onkey unt il you click t he m onkey again) . Greasem onkey on it s own will not do anyt hing in part icular; you st ill need t o add som e cust om script s. This is where ht t p: / / userscript s.org com es in. I t 's a giant direct ory of user- subm it t ed Greasem onkey script s. A query for " gm ail" using t he sit e's search engine ret urns dozens of result s, som e of which are described in det ail here. To inst all any of t he user script s, j ust click t he " I nst all t his script " but t on on t he script det ail page and close and reopen any browser windows t hat you expect t o be affect ed by t he script . To uninst all a script , select Tools Greasem onkey Manage User Script s from t he Firefox m enu, m ark t he script s you want t o uninst all, and click t he " Uninst all" but t on.

    Make sure t hat you t rust t he creat or of a Greasem onkey script , as a script m ay t ake part ial cont rol over your browser. Also not e t hat it m ay be against t he t erm s of service of som e web applicat ions t o perform any aut om at ion against t heir web sit e. I n general, t hough, Google seem s t o be okay wit h people Greasem onkeying t heir apps, and even Google em ployees have been publishing add- on script s on t heir personal blogs. Unfort unat ely, because Greasem onkey script s rely on t he specifics of a sit e's underlying HTML and JavaScript , t hey m ay st op working if t he sit e in quest ion changes t he st ruct ure of t heir web sit e significant ly. Som e of following Greasem onkey script s, while funct ional at t he t im e of t his writ ing, m ay not work when you t ry t his, m aking it necessary t o t ry look for a replacem ent script by anot her aut hor, or a newer version of t he script you're t rying.

    Here are som e cool t hings you can do wit h Gm ail and Greasem onkey: Gm a il w it h diffe r e n t a t t a ch m e n t icon s URL: ht t p: / / userscript s.org/ script s/ show/ 7056 When you open your Gm ail inbox, you can t ell whet her a m essage includes an at t achm ent . But you won't be able t o im m ediat ely see what file t ype t he at t achm ent is, because Gm ail always uses t he sam e paperclip icon. Not so wit h t his Greasem onkey script . Aft er adding it and opening Gm ail, you will not ice an im age icon for im ages, a PDF icon for Adobe Acrobat files, and so on, as shown in Figure 5- 10. ( Not e t hat because t his is a screenshot of m y spam box, I had t o m ake all t he rude subj ect s invisible! ) I f t he file t ype is not support ed by t his Greasem onkey script or if t here are m ult iple at t achm ent s, t he paperclip icon is displayed. Gm a il su pe r cle a n

    URL: ht t p: / / userscript s.org/ script s/ show/ 7646 This Greasem onkey script perform s an ext ensive beaut ificat ion on Gm ail. I f you're already used t o t he default Gm ail layout , t his will t ake som e t im e t o get used t o, but as t he t it le prom ises, t he new look will indeed be super clean ( and full of sm oot h cyan shades, t oo) , as pict ured in Figure 5- 11! Folde r s4 Gm a il URL: ht t p: / / userscript s.org/ script s/ show/ 8810 At t he t im e of t his writ ing, Gm ail uses labels inst ead of t he m ore t radit ional m ail folders. A label is sim ilar t o a folder, in t hat it allows you t o organize your m essages. And unlike wit h t radit ional folders, you can also associat e several labels wit h a m essage at once in Gm ail. However, you cannot creat e nest ed hierarchies of labels at t his t im e. That 's where m ore t radit ional folders can be of help, and t he Folders4Gm ail script provides t hem . Aft er adding t he script , you can now creat e a hierarchy of labels. Let 's say you want t o have a folder " Job" t hat includes t he subfolders " Boss," " I m port ant ," and " Jokes." Open Gm ail and swit ch t o Set t ings Labels, and creat e a new label " Job." Now add anot her label nam ed " Job\ Boss." The backslash you are using for t hat nam e t ells t he Folders4Gm ail script t o put t he " Boss" folder int o t he " Job" folder, as shown in Figure 5- 12. Using t his special synt ax, you can now creat e your own nest ed label/ folder syst em in Gm ail.

    Th e a t t a ch m e n t file t ype is n ow in dica t e d by a spe cia l icon — e ve n be for e you ope n t h e m e ssa ge

    Th e Gm a il in box w it h t h e " Gm a il su pe r cle a n " Gr e a se m on k e y scr ipt

    Gm a il H TM L Sign a t u r e s URL: ht t p: / / userscript s.org/ script s/ show/ 20887 Gm ail allows you t o add a signat ure t o your m essages, but it will not allow you t o use m ore t han one signat ure, or t o use HTML in your signat ure. Wit h t his script you can define an HTML signat ure for each em ail address t hat you use wit h Gm ail. To define a signat ure, st art a new m essage, or reply t o one, t hen click t he Creat e Signat ure link t hat appears t o t he right of your em ail address, as shown in Figure 5- 13. An edit box will appear t o let you t ype in your HTML ( see Figure 5- 14) . Once you've set up your HTML signat ure, you'll see t hat signat ure at t he bot t om of each new m essage, as shown in Figure 5- 15. Not e t hat even t hough t here is a line break in t he HTML, t he t wo lines are run t oget her. I f you want t hem on separat e lines, use a

    or
    elem ent .

    N e st e d la be ls, m a de possible by t h e Folde r s4 Gm a il Gr e a se m on k e y scr ipt

    Click Cr e a t e Sign a t u r e t o cr e a t e a n e w sign a t u r e

    Gm a il Con ve r sa t ion Pr e vie w URL: ht t p: / / userscript s.org/ script s/ show/ 1554 Do you get so m any m essages every day t hat even t he act of opening a m essage t akes t oo m uch t im e? Maybe you're in need of t he Gm ail Conversat ion Preview script . Aft er inst alling, you can right - click any subj ect line in

    your inbox t o open a speech- bubble- like inst ant preview, as shown in Figure 5- 16. Assum ing t hat opening a m essage usually t akes you 2 seconds, and furt her assum ing you get 50 m ails a day, t his will save you alm ost 10 hours every year . . . enough t o wat ch t he com plet e Godfat her t rilogy wit h your friends!

    Cr e a t in g a n e w H TM L sign a t u r e

    Usin g you r n e w H TM L sign a t u r e

    Th e Gm a il Con ve r sa t ion Pr e vie w scr ipt in a ct ion

    H a ck 4 3 . Re a d Gm a il on You r M obile Ph on e Wouldn't it be nice t o access your m ail wherever you are? Online applicat ions are m ade for t his. You don't necessarily need a not ebook and Wi- Fi t o access your em ail on t he go ( in a t rain, at t he shore, on t he bus) . Your m obile phone m ay let you access Gm ail, eit her t hrough it s built - in web browser or t hrough support for Java applicat ions. And if your m ont hly cellular plan gives you access t o m obile dat a for a reasonable m et ered price ( per KB or MB) or bet t er yet , your plan allows unlim it ed dat a access, you have several opt ions t o add Gm ail t o your phone.

    Cellular dat a plans are eit her unlim it ed or billed on a per- KB basis. I f you are unsure of what cellular dat a plan you have, be sure t o check wit h your cellular carrier before t rying t his hack. Be careful using any cell phone applicat ion t hat accesses t he Web, as it is possible t o rack up large charges if you have not set up an affordable cellular dat a plan.

    The Gm ail web sit e allows you t o choose bet ween t wo different m ain flavors: an advanced version wit h all t he bells and whist les, as well as a m ore basic HTML version. Alt hough t he basic HTML version lacks m any feat ures, it 's also m ore accessible on older browsers, and it 's likely t o work bet t er wit h t he st ripped- down or slower browsers you find on sm aller devices. To swit ch t o t he basic version at any t im e—whet her you're accessing Gm ail from your deskt op com put er, or anywhere else—j ust click t he " basic HTML" link at t he bot t om of Gm ail. I n t he basic version, you m ay not ice t hat t he applicat ion needs less resources and m ay load fast er for you. I t also com es wit h som e accessibilit y enhancem ent s. The m aj or downside wit h t his version is t he lack of aut ocom plet ion of em ail addresses. Som e advanced m obile browsers already work fine wit h t he basic version of Gm ail. For ot her devices, it 's not yet basic enough. A leaner variant of Gm ail is Gm ail m obile, which you can access by visit ing ht t p: / / gm ail.com from your m obile browser ( if it doesn't appear, visit ht t p: / / m .gm ail.com ) . Google should aut om at ically det ect t hat you're browsing from a m obile device and show you a web page t hat 's opt im ized for your device's capabilit ies. Figure 5- 17 shows how Gm ail appears in t he Nokia N95 web browser. I f you don't like your phone's exist ing m obile browser, you can give Opera Mobile or Opera Mini ( ht t p: / / opera.com ) a t ry. I n Gm ail m obile, as shown in Figure 5- 18, you see only t he sender nam es and t it les of em ails, as well as a few navigat ion links and a search box below t hem . By default , Gm ail m obile won't show your labels, but you can click t he " m ore" link at t he bot t om t o act ivat e som e of t hem .

    On e of Gm a il's m obile va r ia n t s

    But Gm ail m obile doesn't j ust m obile- opt im ize your m essages. When you click on an out going link som eone sent you wit hin an em ail, Google will also display t hat web sit e in a version adapt ed for your phone. Figure 5- 19 displays how Google displays t he popular blog Boing Boing ( ht t p: / / boingboing.net ) by filt ering it s t ext and im ages t hrough a proxy ( an ext ra server placed bet ween your browser and Boing Boing's server) which cut s & chops everyt hing int o sm aller, m ore edible pieces. Yet anot her opt ion for em ail reading is t o download a m obile Gm ail program . I f your phone support s t he Java fram ework, you can point your phone browser t o ht t p: / / gm ail.com / app t o get st art ed wit h t his. ( Alt hough t he downloadable program looks nicer on som e phones, on ot her phones, it m ay also cause problem s—like t oosm all font sizes.)

    N OTE Java is an applicat ion plat form t hat let s soft ware developers creat e program s t hat can run, wit h ( t heoret ically! ) lit t le or no m odificat ion, on different operat ing syst em s, including m obile device operat ing syst em s. I t is available on m any m odern m obile phones.

    Gm a il m obile

    As if four opt ions t o access your em ails weren't enough, Google offers a fift h: POP or I MAP access t o your em ail. POP and I MAP are short for Post Office Prot ocol and I nt ernet Message Access Prot ocol, respect ively; bot h are st andards for sending m ail. For t his alt ernat ive t o work, your phone needs a built - in em ail applicat ion support ing POP or I MAP access ( if you're unsure, please refer t o your phone's m anual or built - in help files t o find out whet her t his is support ed) . You also need t o enable POP in Gm ail. Log in t o Gm ail.com and click Set t ings Forwarding and POP/ I MAP. Select eit her t he Enable POP or Enable I MAP radio choices, and hit t he Save Changes but t on. I f your phone support s I MAP, t hat 's t he best choice, because I MAP t reat s Gm ail as a rem ot e collect ion of folders, and what you see on your phone is in sync wit h what you'd see if you opened Gm ail via a web browser. Gm ail's I MAP even m akes all your labels appear as rem ot e folders, and you can m ove a m essage from t he I nbox int o an I MAP folder t o apply t hat label t o it . POP, on t he ot her hand, pulls down copies of t he m essages t hat arrive on t he Gm ail server, so t he view you get on your device and t he view you get on t he web are not in sync. Now if only t here were as m any ways t o get rid of spam m ail!

    Boin gBoin g.n e t displa ye d t h r ou gh Google 's m obile pr ox y

    H a ck 4 4 . Or ga n ize M e ssa ge s a s Th e y Ar r ive I f you get a lot of m essages every day, a lit t le Gm ail aut om at ion can go a long way t oward st aying organized. Our hypot het ical Gm ail user Bet h get s a lot of em ails at her office, where she's using Gm ail—about a hundred, every day, from all kinds of people: friends, fam ily, colleagues ( and com plet e st rangers offering all kinds of com m ercial endeavors; hopefully t hese m ake it t o her spam folder) . She's using a variet y of t ricks t o m aint ain cont rol of her m ails; she's subscribed t o a j okes m ailing list , for inst ance, but because she refuses t o open PowerPoint j okes, all j okes wit h t hat at t achm ent t ype go st raight t o her t rash can. She also st art ed working on a new proj ect developing fluorescent keyboards t o t ype at night , and all m ails in relat ion t o t hat proj ect are grouped t oget her nicely under one label. When her biggest client , Albert , em ails her, she aut om at ically has his m essages st arred. Plus, whenever she get s m ails from her fam ily, she forwards t hem t o her hom e address. Gm a il's Se a r ch a n d Filt e r Syn t a x To m ake all of t his possible, you can use Gm ail filt ers, which are based on Gm ail's search synt ax. A basic search in Gm ail looks for exact m at ches in t he whole of an em ail; it s subj ect , it s " from " field, " t o" field, m essage body, and m ore. The following search ret urns all m ails cont aining t he words " invit at ion" and " inquiry" : invitation inquiry

    I f you want t o find em ails cont aining eit her of each word, use t he OR operat or. Make sure t o writ e t he operat or in all uppercase—alt hough keywords used in searches are not case- sensit ive, t his operat or is: invitation OR inquiry

    I n t he following search, t he pipe charact er "|" is a synonym for OR, and parent heses group t he t erm s t oget her ( t his m eans t hat t he | applies only t o t hose t wo grouped t erm s) . To exclude cert ain words, use t he m inus operat or, as before " j oin" : (invitation | inquiry) -join

    Quot es ensure t hat only t he ent ire phrase is found: subject:"partnership offer"

    A slight variat ion of t he previous query, shown here, searches for bot h words in t he subj ect line but not necessarily as a full phrase. Not e t hat t here's no space aft er t he colon: subject:(partnership offer)

    Use t he from: or to: operat ors followed by a colon t o search only am ong sender or recipient s: from:arthur OR from:[email protected]

    Sim ilarly, you can use t he operat ors subject: t o only search in em ail subj ect s, filename: t o search for at t achm ent nam es and ext ensions, or cc: and bcc: t o search in t he carbon copy and blind carbon copy fields. The following search finds m essages t hat are eit her from Mike, or t hat include t he word " inquiry" in t he subj ect and have an at t achm ent wit h a TXT ext ension:

    from:mike OR(subject:inquiry filename:.txt)

    N OTE Not e t hat by default , your queries do not search t hrough t he spam or t rash boxes, even when you use t he search box while in your spam or t rash box. To include t hose t wo in a search, click " Show search opt ions" on t op and pick " Mail & Spam & Trash" from t he Search drop- down m enu.

    Cr e a t e a N e w Filt e r Wit h t he Gm ail search operat ors in m ind, you can now creat e filt ers. A filt er is applied t o em ails as soon as t hey arrive in your em ail account . Am ong ot her act ions, you can forward a m essage, st ar it , or apply a label t o group it wit h ot her m ails. To creat e a new filt er, log in t o Gm ail and click " Creat e a filt er" on t op. You now have several input fields t o choose from t o com pose a search, but you can also sim ply use your cust om advanced search synt ax in t he " Has t he words" field. Ent er t he following, for inst ance: from:miguel OR from:jenny

    and hit t he " Test search" but t on, as shown in Figure 5- 20. I f you see t he kind of result s you want ed t o t arget , click t he " Next St ep > " but t on and choose your act ion, or a com binat ion of act ions. For t his exam ple, I picked " Skip t he inbox" and " Apply t he label: Office." Save t he filt er by clicking t he " Creat e Filt er" but t on, and you're Filt ers from t he Gm ail done. You can edit or com plet ely rem ove a filt er at any t im e by choosing Set t ings m enu. H ow Be t h H a n dle s H e r Filt e r s But back t o Bet h; here's how she achieves her different em ail organizat ion t ricks. To avoid any PowerPoint at t achm ent s from her j okes m ailing list , Bet h uses t he following filt er and checks t he " Delet e it " box: subject:jokes filename:ppt

    To group all m ails in relat ion t o her fluorescent keyboard proj ect , she creat ed t he label " fluorescent " and t hen creat ed t he following search filt er, choosing t he " Skip t he I nbox" and " Apply t he label: fluorescent " opt ions: fluorescent OR keyboard OR FluoKeys3000

    To add a st ar t o all of Albert 's m ail t o m ake sure she can respond in t im e, Bet h uses t his filt er ( and checks t he " St ar it " box) : from:[email protected]

    And t o forward her fam ily m ail t o her privat e em ail account , she uses t he following search filt er, while providing her hom e address in t he " Forward it t o" field: from:(joey OR meredith OR paula OR sammy OR ruthbert)

    Cr e a t in g a Gm a il filt e r

    H a ck 4 5 . Gm a il D r ive , You r On lin e H a r d D r ive There's a long- rum ored Google product called Gdrive, a virt ual st orage syst em t hat let s you access your files from anywhere. Google em ployees already use Gdrive int ernally. But t here's a second, unofficial product out t here for t he rest of us t hat already brings Gdrive funct ionalit y . . . by kidnapping Gm ail. I f you're in need of m ore st orage space t han your hard disk offers, you can buy a new one—or out source som e of t he space t o an online drive. One way t o do so is by inst alling Gm ail Drive, a t hird- part y product t hat handles your files by sending t hem t o Gm ail behind t he scenes.

    Gm ail Drive m ay cease working anyt im e t hat Google decides t o block it or change t he workings of t heir Gm ail program . Also not e t hat Gm ail Drive requires you t o ent er your Google Account credent ials; always do t his only if you sufficient ly t rust t he aut hor of any program , and underst and enough about t he program 's securit y m odel t o t rust it t o keep your credent ials secure. Please not e t here's a serious caveat t o using t his Gm ail Drive program —a caveat big enough t hat you m ay decide you m ay not want t o t ry t his hack at all, or use it only on a Google account t hat doesn't cont ain highly im port ant dat a! Th e ca ve a t h e r e is t h e fa ct t h a t Google m a y lock t h e a ccou n t s of pe ople w h o u se file st or a ge soft w a r e on t op of it . For m ore inform at ion on t his please refer t o t he Gm ail t erm s of use, as well as t he help ent ry at ht t p: / / m ail.google.com / support / bin/ answer.py?answer= 43692 .

    To inst all Gm ail Drive, you need Windows XP/ 2000 or Vist a. Open ht t p: / / viksoe.dk/ code/ gm ail.ht m and look for t he download link at t he bot t om . Aft er downloading and running t he set up files, you will find t hat your Windows Explorer My Com put ers folder has a new it em : Gm ail Drive. Click on it and you are required t o ent er your Google Account login nam e and password, as shown in Figure 5- 21. You can check t he " Aut o Login" opt ion if you want t o, or access furt her opt ions via t he " More" but t on.

    Loggin g in t o Gm a il D r ive

    I f you logged in successfully, you can st art t o use your Gm ail Drive folder alm ost like any ot her folder. Give it a t ry by dragging and dropping a file from elsewhere on your com put er int o t his folder. The copy process m ay t ake a while. I copied a file called net padd.zip , for inst ance, as shown in Figure 5- 22. What act ually happens here is t hat Gm ail Drive sends your file as an at t achm ent t o your Gm ail account . You can see t his for yourself by logging in t o Gm ail, as shown in Figure 5- 23. A new em ail st art ing wit h t he subj ect " GMAI LFS" appears in your inbox; you can open t hat em ail and download t he at t achm ent , if you want t o.

    Gm a il D r ive n ow st or e s t w o ZI P file s

    Th e file you copie d t o you r Gm a il D r ive w ill a ppe a r a s a n a t t a ch m e n t in Gm a il

    However, t o hide t he m essages sent t o you by Gm ail Drive, you can add a filt er [ Hack # 44] . Click " Creat e a filt er" and ent er t he word " gm ailfs" in t he subj ect input box. Click " Next St ep" and check t he " Skip t he I nbox" and " Apply t he Label. . . " opt ions. Creat e a new label nam ed " Gm ail Drive" ( or any ot her nam e t hat you prefer) . Now save your filt er and you're done, as shown in Figure 5- 24.

    By st oring your t ext docum ent s, spreadsheet s, ZI P files, m ovies, m usic, and ot her files t his way, you can access t hem from any deskt op com put er or lapt op around t he world, as long as it 's got Gm ail Drive inst alled. And even if you are on a com put er t hat doesn't allow you t o inst all new program s, like in an I nt ernet café, you can go back t o your Gm ail account t o find your files. Your only lim it at ion wit h t his approach is t he st orage lim it at ion of Gm ail it self. I f you want t o increase your em ail st orage, t ake a look at ht t p: / / google.com / account s/ ManageSt orage t o buy addit ional GB of st orage. An Alt e r n a t ive : Gm a ilFS Anot her opt ion for st oring files wit h Gm ail is Gm ailFS, t he Gm ail Filesyst em . This m ount able Linux filesyst em requires som e syst em adm inist rat ion and developm ent knowledge t o set up, as it 's based on t he Pyt hon program m ing language and ot her t echnologies. A full inst allat ion guide for Gm ailFS is locat ed at ht t p: / / richard.j ones.nam e/ google- hacks/ gm ail- filesyst em / gm ail- filesyst em .ht m l. Mac OS X users can consult t he guide at ht t p: / / blog.m acos.fr/ post / 2007/ 01/ 18/ GMailFS- for- Mac- OS- X.

    The sam e caveat s m ent ioned earlier apply t o Gm ailFS—be aware t hat Google m ay lock Gm ail account s of people using file st orage apps on it !

    Cr e a t in g a filt e r t o gr ou p a ll Gm a il D r ive m e ssa ge s u n de r on e la be l

    H a ck 4 6 . Kn ow You r Gm a il Ke yboa r d Sh or t cu t s Want t o work even fast er in Gm ail? Consider swit ching from m ouse t o keyboard for cert ain repet it ive t asks. Alt hough browsers offer a range of default keyboard short cut s, for quit e som e t im e it wasn't com m on for web applicat ions t o m ake use of t heir own advanced short cut s. That was t he realm of deskt op soft ware—t he kind of soft ware t hat ships in a box and requires you t o inst all it , but t hat also has a t radit ionally m uch richer int erface. But as t im e progressed, so did t he richness of web applicat ions. Google is one of t he com panies st ret ching t he lim it s of what 's possible in online int erfaces. Som et im es t hat result s in longer wait ing t im es for your applicat ion t o load, or ot her accessibilit y hurdles. At ot her t im es, it m ay allow you t o get your work done fast er . . . as is t he case wit h keyboard short cut s. What follows is an overview of t he m ost im port ant Gm ail short cut s, shown in Table 5- 1. Before you use t hem , m ake sure t hat you have short cut s enabled. I n Gm ail, go t o Set t ings, check t he " Keyboard short cut s on" opt ion, and click t he Save Changes but t on. Not e t hat in order t o avoid int erference wit h your norm al writ ing, t hese short cut s work only when your cursor is out side of a new em ail com posit ion box, t he search box, or any ot her input area. However, you can leave an input field at any t im e by hit t ing t he Escape key.

    Ta ble Gm a il k e yboa r d sh or t cu t s KEYSTROKE

    D ESCRI PTI ON

    c

    Com pose a new em ail m essage. Use Shift - c t o open t he current m essage in a new window. Opening a new window m ay t ake a few seconds.

    r

    Reply t o a m essage t hat you've opened. Use Shift - r t o open t he reply in a new window.

    j

    Move t he focus t o t he next conversat ion. To t he left of your m ail m essages, you will see a sm all arrow indicat ing which m essage has focus.

    k

    Move t he focus t o t he previous conversat ion.

    En t e r

    Open t he current ly focused conversat ion.

    Sh ift ( while select ing m essages)

    Select several m essages at once. Let 's say you see 20 new spam m ails in a row in your inbox and you want t o m ark t hem as spam , accordingly. Just check t he box of spam m ail 1, hold down t he Shift key, and t hen check t he box of spam m ail 20 down t he list . You will find t hat m essages 2–19 have now been select ed for you as well.

    Sh ift ( while opening a m essage)

    Holding down t he Shift key when you click on a new m essage result s in t he m essage being opened in a new window. Not e t hat t his feat ure, as well as t he previous one for m essage select ion, works even if you've disabled short cut s.

    u

    When reading a conversat ion in det ail view, t his short cut ret urns you t o t he inbox.

    x

    Toggles t he st at e of t he checkbox t o t he left of t he current ly focused conversat ion.

    m

    Mut es one or m ore conversat ions ( eit her t he conversat ion you current ly have open or conversat ions you have select ed wit h t he checkboxes t o t he left ) . I f a conversat ion is m ut ed, all new m essages added t o it lat er on will be aut om at ically archived for you—skipping t he inbox so you can easily ignore t hem , but st ill have t hem available when you search for t hem . This is a special short cut for special circum st ances; it 's m ost ly useful for when you are subscribed t o a m ailing list and you want t o ignore a specific t hread. Not e t hat m essages direct ly addressed t o you st ill m ake it int o your inbox as usual, even when t hey are part of a m ut ed conversat ion.

    KEYSTROKE

    D ESCRI PTI ON

    !

    This short cut flags a m ail as spam . As wit h ot her short cut s, you can undo t he operat ion im m ediat ely aft erwards by clicking " Undo."

    /

    Takes you t o t he search box. You can now st art t yping any search query [ Hack # 44] and hit Ret urn.

    N OTE For a com plet e list of Gm ail short cut s, see ht t p: / / m ail.google.com / support / bin/ answer.py?answer= 6594. I f you've enabled short cut s in your set t ings, you can also press t he ? key anyt im e t o open a cheat sheet of available short cut s, and you can close t hat sheet wit h t he Escape key.

    And in case you're not sat isfied wit h all t he exist ing short cut s, you can also add your own via t he unofficial Gm ail Macros Greasem onkey script offered by Google's Mihai Parparit a. The script can be found at ht t p: / / blog.persist ent .info/ 2007/ 11/ m acros- for- new- version- of- gm ail.ht m l. Not e as t he Macros hack relies on Greasem onkey [ Hack # 42] , it works only in Firefox.

    H a ck 4 7 . M a k e Gm a il Be t t e r This hack is for t he brave of heart Firefox users who don't m ind com plet ely overhauling t heir Gm ail int erface and funct ionalit y— t hrough t he use of a single add- on. Bet t er Gm ail 2 is a Firefox ext ension t hat collect s an abundance of individual Greasem onkey add- ons [ Hack # 42] all under one hood. Go t o ht t ps: / / addons.m ozilla.org/ en- US/ firefox/ addon/ 6076 t o download t he ext ension, and rest art Firefox. I t was developed by Gina Trapani, edit or of t he Lifehacker blog (ht t p: / / lifehacker.com ) , where you can oft en find updat es and ot her inform at ion about Bet t er Gm ail. Once inst alled, open Gm ail, and t hen open t he Bet t er Gm ail set t ings in Firefox via Tools Bet t er Gm ail 2. A t abbed opt ions dialog, as shown in Figure 5- 25, will appear. Check any of t he feat ures you would like t o see added t o your Gm ail client and reload Gm ail t o see t hem t ake effect . Here are som e of t he available opt ions:

    Make all em ail- t o links on web pages inst ant ly open Gm ail

    Use a fixed- widt h font t o display m essages

    Show t he at t achm ent file t ype as an icon

    Swit ch t o t he " Super clean" Gm ail t hem e, am ong ot hers

    Hide t he spam count er

    and m any m ore. But t he best opt ion of all m ay be " Force encrypt ed Gm ail connect ion." Alt hough Gm ail uses a secure connect ion when you are logging in wit h your usernam e and password, it uses an insecure connect ion when you are reading your em ail, which m eans it is possible for an eavesdropper connect ed t o your wireless or wired net work t o snoop on your em ail.

    Due t o t he changing nat ure of Gm ail, or any ot her web applicat ion, not all Greasem onkey add- ons will work exact ly as expect ed. You can disable t he Bet t er Gm ail ext ension at any t im e by select ing Tools Add- ons Bet t er Gm ail 2: Disable.

    Th e opt ion s dia log of Be t t e r Gm a il 2 , t h e u n officia l e x t e n sion for a dva n ce d Gm a il be h a vior a n d a ppe a r a n ce con t r ol

    H a ck 4 8 . Ba ck Up You r Em a il Google claim s t hat you never have t o delet e your em ails again wit h Gm ail. But what if you delet e som et hing accident ally—or you delet e it because you want t o m ake m ore st orage available, but you realize lat er t hat you want it back? To back up all your Gm ail em ails—j ust in case! —you can inst all t he free em ail client Mozilla Thunderbird ( or anot her sim ilar program ) , download all your m essages, and t hen back up t he file t hat cont ains all your em ail. You can t hen burn t his file ont o a CD, DVD, or copy it t o a hard drive—anywhere where you can keep it safe. Then you can rest ore it at any t im e, even if you've delet ed t he m essages in Gm ail, or even if you no longer have t he Gm ail account . Here are t he st eps involved: 1 . Act iva t e POP in Gm a il For t his hack t o work, you need t o act ivat e POP in your Gm ail. POP is short for Post Office Prot ocol, and it 's a st andard way t o ret rieve m essages from an em ail server. Go t o Gm ail and click Set t ings Forwarding and POP. Check t he " Enable POP for all m ail" box and save your changes. You are now ready t o access your Gm ail m essages wit h a deskt op client , such as Thunderbird. 2 . I n st a ll a n d r u n Th u n de r bir d To inst all Mozilla Thunderbird, point your browser t o ht t p: / / m ozilla.com / t hunderbird/ and click t he Download Thunderbird but t on. You will be asked t o save an execut able file on your disk. Run t he inst aller and com plet e t he set up. Now st art t he Thunderbird program . During launch, you will be guided t hrough an account wizard where you provide your Gm ail credent ials. Just choose Google Mail or Gm ail from t he list of select ions and ent er your nam e and em ail address in t he dialog t hat follows, as shown in Figure 5- 26. Aft erwards, provide your Gm ail password, and your em ail from your Gm ail account will begin downloading ( even t hough t his says I nbox, it really is t he cont ent s of your Gm ail " All Mail" folder) . I f you have a lot of em ail, t his can t ake a long t im e. Figure 5- 27 shows a Gm ail inbox in Thunderbird.

    Pr ovidin g you r Gm a il login cr e de n t ia ls in Th u n de r bir d

    Acce ssin g you r Gm a il m e ssa ge s in Th u n de r bir d

    3 . Fin d you r Gm a il in box file Now you need t o find t he file where Thunderbird st ored your Gm ail m essages. This file uses a st andard m ailbox form at , m box, t hat is support ed by m any em ail program s. To find t he file, you'll first need t o locat e your Thunderbird profile direct ory. Open up a com m and- line t erm inal program : Term inal on Mac OS X ( go t o Applicat ions in t he Finder and look in t he Ut ilit ies subdirect ory) ; Com m and Prom pt on Windows ( click St art All Program s or Program s, t hen choose Accessories Com m and Prom pt ) ; and xt erm or sim ilar on Linux.

    N OTE I f you have m ore t han one profile configured in Thunderbird, you'll need t o first cd t o t he Profiles direct ory, t hen poke around using cd and ls ( Mac OS X or Linux) or dir ( Windows) t o figure out which profile cont ains your Gm ail m essages. The one you're looking for will have a pop.gm ail.com subdirect ory under t he profile's Mail direct ory.

    Next , use t he cd com m and t o " change direct ory" ( swit ch t o t he folder) where Thunderbird st ores it s m ail. On M a c OS X , t ype t he following: cd ~/Library/Thunderbird/Profiles/*/Mail

    On W indow s, t ype t he following ( you can also use t he pat hnam e, m inus t he " cd" in Explorer: cd %APPDATA%\Thunderbird\Profiles\

    Then t ype cd, followed by a space, and press Tab. The com m and will expand t o include your profile direct ory. For exam ple: cd 2punitlu.default

    Next , t ype: cd Mail

    On Lin u x , t ype t he following: cd ~/.mozilla-thunderbird/*/Mail

    Press t he Ret urn or Ent er key aft er you t ype a com m and. Now, leave your com m and- line window open, and proceed t o t he next st ep. 4 . Copy you r in box t o a loca l folde r Now you're ready—or nearly ready—t o m ake a backup copy of all your Gm ail m essages. First , m ake sure t hat Thunderbird is done downloading all your Gm ail. This could t ake quit e som e t im e, so be sure t o double- check. I f you want t o m ake absolut ely sure t hat you've downloaded all your m ail, com pare t he num ber of m essages report ed by Thunderbird ( look at t he lower right of t he Thunderbird window for t he Tot al: field) t o t he num ber of m essages in your Gm ail All Mail folder ( click All Mail, and look in t he upper- m id- left of t he Gm ail window for som et hing like " 1–25 of 11449" or however m any m essages you should have) . When you've downloaded all your m ail, quit Thunderbird. Ret urn t o t he com m and- line window where you changed t o t he Mail direct ory. Use t his com m and t o back up your Gm ail folder on t he Mac or Linux: cp pop.gmail.com/Inbox Local\ Folders/

    Or, on Windows:

    copy pop.gmail.com\Inbox "Local Folders\"

    Rem em ber t o press Ent er or Ret urn aft er you t ype t he com m and. Now, st art Thunderbird up again, and you should see t wo folders wit h ident ical cont ent s: one in t he Gm ail folder, t he ot her in t he Local Folders collect ion, as shown in Figure 5- 28 ( you m ay need t o press t he + sym bol t o t he left of Local Folders t o show t his) . Now you can t ell Thunderbird t o delet e t he Gm ail account ( choose Account Set t ings Gm ail, t hen click Rem ove Account ) . and you'll st ill have a copy of t he m essages. Tools I f you want t o back t his file up t o CD or DVD, follow t he preceding inst ruct ions t o locat e t he file, and copy it t o anot her locat ion, t hen burn it . I f you find it easier t o work wit h t he Mac OS X Finder or Windows Explorer, you can open t he folder quickly from t he com m and line. On t he Mac, use t he preceding inst ruct ions t o navigat e t o t he folder at t he com m and line, t hen t ype t his com m and and press Ent er: open .

    On Windows, use t his com m and: start .

    Google already prom ises t o st ore backups of your em ails in m ult iple locat ions—and it 's not known t o random ly crash, like your com put er m ay—but bet t er safe t han sorry, especially considering t hat you could accident ally delet e an em ail yourself! — Brian Jepson and Philipp Lenssen

    You r Gm a il m e ssa ge s, a ll ba ck e d u p

    H a ck 4 9 . At t a ch a Google D ocs D ocu m e n t t o You r Em a il There are m any ways t o send a Google docum ent . Here are t he alt ernat ives at your disposal. You j ust creat ed a new t ext docum ent in Google Docs discussing t he life and t im es of Napoleon Bonapart e, as shown in Figure 5- 29. How do you send t his file t o som eone else t o have a look at , t oo? There are several ways t o accom plish t his, each wit h t heir own pros and cons. Opt ion 1 : At t a ch a W or d file You could save t he file as Word in Google Docs, and at t ach t he Word file t o your em ail m essage. Go t o Google Export as Word. . . from t he m enu. Save t he Docs, open your docum ent from t he file list , and choose File Word file, and head over t o Gm ail t o com pose a new m essage. Click " At t ach a file," select t he Word file you want t o send, and click Send. Pr os: People are already used t o receiving Word at t achm ent s, and t hey do not need a Google Account t o edit your file. Con s: When you export your Google docum ent int o t he Microsoft Word form at , som e form at t ing det ails m ay be changed aft er t he conversion. Also, when you send a docum ent as an at t achm ent , you are sending a m ere copy; any edit s t he recipient m akes t o t he docum ent are not aut om at ically reflect ed in your docum ent . Reint egrat ing changes int o your source docum ent st ored at Google Docs can be a hassle.

    N OTE I f you select t he at t achm ent before t yping your em ail, you will save som e t im e, because Google st art s uploading t he file t o it s server while you are t yping t he m essage. Also, t his way t here is less of a chance t hat you'll m ent ion an at t achm ent in your m ail but act ually forget t o at t ach it , a com m on m ist ake t hat happens t o m any of us.

    A Google docu m e n t discu ssin g N a pole on Bon a pa r t e

    Opt ion 2 : Sh a r e t h e D ocu m e n t w it h On e Pe r son or a Sm a ll Gr ou p Sharing a Google Docs docum ent m eans giving anot her Google Account user t he right t o access your docum ent . However, you need not creat e a copy of t he file in order t o do so; bot h you and t he recipient will be edit ing t he sam e file, pot ent ially at t he sam e t im e [ Hack # 2] .

    To share a docum ent , open it in Google Docs and swit ch t o t he Share t ab. Ent er t he recipient ( or group of recipient s) , and uncheck " I nvit at ions m ay be used by anyone" if you want only t his single recipient ( or group) t o access t he docum ent . Click " I nvit e collaborat ors" and you are offered t he opport unit y t o writ e a cust om invit at ion m essage. Aft erwards, you're done and t he recipient will get a link t o your docum ent in t heir em ail inbox. The recipient s do not need a Google account t o see t he docum ent , t hough t hey do need one t o edit it . I f t he recipient s are logged in t o Google, t hey are present ed wit h a full Google Docs edit or; if t hey are not logged in, t hey will j ust see an unedit able, sim pler web page wit h a foot not e link reading " Edit t his page ( if you have perm ission) ."

    I f you uncheck t he " Collaborat ors m ay invit e ot hers" box, t he people you invit e won't be able t o grant access t o ot her users. This set t ing also forces anyone who want s t o read t his docum ent t o log in t o t heir Google account first . Now t he docum ent is also not easy t o forward any m ore. Keep t he box checked, however, and your docum ent will be available on an unlist ed URL ( a URL t hat is alm ost im possible t o guess by out siders) .

    Pr os: By sharing a docum ent you can use t he full range of Google Docs collaborat ion feat ures. Google will show you when som eone else edit s t he docum ent ; you will see changes on t he ot her end reflect ed in t he docum ent on your end in near real- t im e; t here will be a revision hist ory for t he docum ent , and so on. Con s: I f recipient s want t o edit t he docum ent t hey receive, t hey m ust have a Google Account , like a Gm ail account , or m ust sign up for one [ Hack # 1] . And if t hey want t o forward your docum ent t o som eone else, t hey m ust first underst and t he concept of Google Docs sharing. For som e, j ust handling an at t achm ent m ay be easier. Opt ion 3 : Pa st e t h e D ocu m e n t I n t o t h e M e ssa ge Body Wit h t his opt ion, you j ust copy t he full cont ent of t he Google docum ent . Open your Google docum ent , select t he full page, and press t he copy short cut —Cont rol/ Com m and- C. Then, open a com pose window in Gm ail and swit ch t o rich- t ext edit ing m ode ( if you aren't already in t his m ode) by clicking " Rich form at t ing." Past e t he docum ent in, click Send, and your recipient will receive your t ext . Pr os: The recipient of your em ail will be able t o st art reading your t ext im m ediat ely, wit hout opening any addit ional files, or signing up for a Google Account . By hit t ing reply in t heir em ail client , recipient s m ay also cit e from part s of your t ext t o add t heir com m ent s below it , as is t ypical in em ail conversat ion. The recipient can also decide t o forward part s of your docum ent t o som eone else by using a forward opt ion, rem oving select ed part s from t he em ail body. Con s: Not all em ail client s handle display det ails sim ilarly, so som e of t he form at t ing m ay end up wrong. For inst ance, m any em ail client s do not direct ly show im ages unt il a special but t on or link is clicked. Also, your recipient won't be able t o direct ly collaborat e wit h you on t he docum ent , as t hey could wit h a shared Google docum ent , and any subsequent changes you m ake t o t he docum ent are not reflect ed on your recipient 's end. I f you realize lat er on t hat a part of your t ext needs a correct ion, you have t o resend t he file.

    N OTE Why do em ail client s oft en hide im ages in m essages, unless you act ively approve showing t hem ? One reason is your privacy and safet y; if an im age wit hin an em ail is not sent wit h t he m ail but st ored on anot her server, t hen t hat server's owner m ight know when you open t he em ail—t heir web server log is updat ed each t im e a file is ret rieved from it , so t hey can det erm ine when you loaded t he pict ure t hey sent t o you. I f t hey gave t he pict ure a file nam e unique t o each recipient , t hey can precisely know who

    read t he em ail t hey sent , and when. This could be pot ent ially abused by a bulk j unk m ail sender t o verify t hat a recipient em ail address is indeed act ive, which could lead t o furt her j unk m ail.

    Opt ion 4 : Pu blish t h e Google D ocu m e n t a s a W e b Pa ge t o be Se e n by M a n y I f your docum ent 's cont ent is not of a very privat e nat ure—t he t ext on Napoleon's life is not , despit e his affairs! —you can also publish it as a web page. Open your Google Docs docum ent and click Publish. Check t he " Aut om at ically re- publish when changes are m ade" box and click " Publish docum ent ." Alt ernat ively, you can also publish t he Google Docs docum ent as a blog post [ Hack # 11] . Now you can com pose a new m essage and m anually past e t he link of your published page int o t he m ail. Pr os: I f you want your docum ent t o be t ruly public, t his is t he easiest alt ernat ive. The recipient of your docum ent can now easily forward t he link you sent t o ot hers. For reading your docum ent , no Google Account is needed for t his. Con s: Though t he URL of your docum ent m ay not be known by everyone, t he file is also not com plet ely privat e. Use t his opt ion for public docum ent s only.

    H a ck 5 0 . Vie w Un r e a d M e ssa ge s Quickly find out st anding m essages t hat m ight need a reply. I f you receive a lot of em ail m essages every day, you m ight not be able t o read each of t hem in a t im ely m anner. Over som e weeks, unread m essages m ay pile up in your inbox—but t here is no left hand navigat ion ent ry in Gm ail t o see all of t hem . I nst ead you m ay find yourself m oving t hrough page aft er page of your inbox t o find t he m essages you st ill want ed t o read, and possibly reply t o. But t here's an easier way t o do t his. Ent er is:u n r e a d la be l:in box int o t he Gm ail search box, and you will find all unread m essages in t he result s. This synt ax is part of t he advanced Gm ail search synt ax [ Hack # 44] . Now, a search such as " is:u n r e a d la be l:in box" is slight ly hard t o rem em ber. However, you can bookm ark any search result s you're seeing in Gm ail. To have t he bookm ark always in view, you can add it t o your bookm ark bar. For exam ple, t he URL of t he preceding search result will be: http://mail.google.com/mail/#search/is%3Aunread+label%3Ainbox

    N OTE I f you're using an older version of Gm ail ( norm ally, you m ust click Older Version at t he t op of t he Gm ail screen t o enable t his older version) , you will not ice t hat searches cannot be bookm arked, because t hey don't have t heir own dist inct ive URL. I n t hat case, t ry t he Persist ent Searches Greasem onkey script by Google em ployee Mihai Parparit a at ht t p: / / gm ailgreasem onkey.googlecode.com / svn/ t runk/ script s/ gm ail- saved- searches.user.j s.

    H a ck 5 1 . I n se r t Pse u dogr a ph ica l Em a il Sign a t u r e s Surprise your recipient s by adding som e pseudographical glit z t o your em ail signat ure. Google's em ail client doesn't ship wit h a nat ive way t o add graphic signat ures. Even if it would, m ost em ail client s receiving your m essage are configured so t hat t hey won't display graphics by default anyway ( at least not if t he im age is ext ernally host ed, inst ead of being included in t he m ail it self) . But t here's a workaround for t his: you can use Unicode sym bols [ Hack # 12] , which render as graphics but are j ust t ext charact ers. Fin din g t h e Righ t Un icode Ch a r a ct e r You can use any Unicode charact er you want , but a couple of sym bols creat e especially good- looking signat ures. The easiest way t o find t hem is t o copy and past e t he charact er you like from a charact er t able found online. Here are som e good point ers t o get you st art ed digging for t he right " icon" : M isce lla n e ou s sym bols ( Figure 5- 30) URL: ht t p: / / en.wikipedia.org/ wiki/ Miscellaneous_Sym bols Ar r ow sym bols ( Figure 5- 31) URL: ht t p: / / en.wikipedia.org/ wiki/ Arrow_% 28sym bol% 29 " D in gba t " ch a r a ct e r s ( Figure 5- 32) URL: ht t p: / / en.wikipedia.org/ wiki/ Dingbat M isce lla n e ou s t e ch n ica l sym bols ( Figure 5- 33) URL: ht t p: / / en.wikipedia.org/ wiki/ Miscellaneous_Technical_% 28Unicode% 29

    M isce lla n e ou s sym bols

    Ar r ow sym bols

    D in gba t sym bols

    Te ch n ica l sym bols

    N OTE Som e sym bols work bet t er t han ot hers when displayed in sm aller font s. The t elephone sym bol, for inst ance, m ay be hard t o m ake out in rat her sm all font sizes, and a charact er like a cross, bullet point , sm iley, or arrow is m ore flexible in different cont ext s.

    Addin g t h e Ch a r a ct e r t o You r Sign a t u r e Once you have som e good charact ers, log in t o Gm ail and click t he Set t ings link on t op. Copy and past e your sym bols, along wit h your norm al signat ure dat a ( like your blog/ hom e page address or your t elephone num ber) int o t he signat ure box and press t he Save Changes but t on. You will now find a result sim ilar t o t he one shown in Figure 5- 34 on out going em ails. Cr e a t in g La r ge r Un icode Ar t Pie ce s Not sat isfied creat ing one- or t wo- liner signat ures? Well, you can com bine m ult iple Unicode charact ers t o form a larger pict ure, as shown in Figure 5- 35. The following Unicode set com es in handy for t his t ask: Box dr a w in g ch a r a ct e r s ( Figu r e 5 - 3 6 ) URL: ht t p: / / en.wikipedia.org/ wiki/ Box_drawing_charact ers Experim ent wit h t he kind of pseudographics effect s you can achieve using t hese sym bols. However, not e t hat you should not m ix norm al charact ers int o t he " Unicode art " you creat e—not even blanks, or Unicode sym bols from ot her set s—because t hat will render your pict ures indiscernible in em ail client s t hat use a proport ional font t o display m essages. Furt herm ore, rest rict your signat ure lengt h t o a m axim um of 72 charact ers per line, so t hat it won't get cut off by line breaks in cert ain em ail client s. To get m ore signat ure inspirat ion, you can also do a Google search for t he phrase " ASCI I art ," result ing in finds like t he one shown in Figure 5- 37.

    N OTE Thanks t o Piot r Konieczny of ht t p: / / blog.konieczny.be for sending along t he inspirat ion for t his hack.

    An e x a m ple of a Un icode sign a t u r e in Gm a il

    M u lt iple Un icode ch a r a ct e r s—1 0 , in t h is ca se — for m a sin gle la r ge r sh a pe

    Box dr a w in g ch a r a ct e r s

    A fu ll- blow n ASCI I / Un icode a r t pie ce

    H a ck 5 2 . For w a r d M e ssa ge s t o You r Ce llph on e I f your cellphone provider offers an em ail address t o receive SMS m essages, you can kidnap t his address t o forward cert ain m essages t o your m obile phone as t ext m essages.

    N OTE Thanks t o Bryan Burkholder for suggest ing t his hack.

    Depending on your m obile phone provider, you m ay be able t o forward select ed em ail m essages t o your cell phone via SMS. For inst ance, let 's say you are a webm ast er for t he large web sit e Exam ple.org. Whenever t he server get s t raffic peaks t hat cause t he server CPU t o work overt im e, you want t o get an alert right away. You don't always check your em ail, but you always carry your cellphone wit h you, and a sound alert s you when a new t ext m essage arrives—a m essage like " There's a t raffic peak at Exam ple.org, please check soon! " But j ust how do you get Gm ail t o cont act your phone? Here's how; first , you need t o det erm ine which m essages you want t o forward. I n t he case of above exam ple, you should first m ake sure t hat t he st at us m essages sent from your server t o your Gm ail account will always be using t he keyword [ cellphone alert ] som ewhere in t he subj ect . You'll have t o configure t his on your server, or what ever device is sending you not ificat ions. Now, you can define a filt er [ Hack # 44] . I n Gm ail, click " Creat e a filt er" next t o t he search box. I n t he Subj ect field, ent er " cellphone alert " or " [ cellphone alert ] " and click t he Test Search but t on t o check t he result s, as shown in Figure 5- 38. I f it is correct , click Next St ep, and in t he new dialog page check t he " Apply t he label" box, and creat e a new label nam ed " Sent t o cellphone." Also, check t he " Skip t he I nbox" field. I n t he " Forward it t o" box, ent er t he em ail address your cellphone provider offers you, like yournum ber@m essage.allt el.com , as shown in Figure 5- 39. Check wit h your phone provider's t echnical support if you want t o find out if such an address schem e is offered in t heir service, and how you can det erm ine or creat e your address.

    N OTE Pingdom .com offers a sim ilar ( paid) alert service and can be configured t o send you an em ail or SMS during server downt im es.

    St e p 1 of 2 in se t t in g u p a for w a r d filt e r

    The Wikipedia page on SMS Gat eways has a list for m any m aj or cellular carriers: ht t p: / / en.wikipedia.org/ wiki/ SMS_gat eways. Here are a few. Be sure t o double check your carrier's web sit e or cont act t ech support , because t his inform at ion is subj ect t o change:

    AT&T Wireless: num ber@t xt .at t .net

    Fido: num [email protected]

    Rogers: num [email protected]

    Sprint : num ber@m essaging.sprint pcs.com

    Sprint Next el: num [email protected] el.com

    T- Mobile USA: num ber@t m om ail.net

    Verizon Wireless: num ber@vt ext .com

    Approve t he dialog by hit t ing t he Creat e Filt er but t on, and your phone is ready t o receive t hose Exam ple.org server st at us alert s! Each alert t hat 's being sent will addit ionally be archived in Gm ail under t he label " Sent t o cellphone," so you can find it lat er if needed.

    St e p 2 of 2 in se t t in g u p a for w a r d filt e r —you r ce llph on e is n ow r e a dy t o r e ce ive SM S a le r t s for spe cific e m a ils

    H a ck 5 3 . Cr e a t e Spa r e Gm a il Addr e sse s You t hink you have only a single Gm ail em ail address? Not quit e t rue—you've got a nearly unlim it ed num ber already. Gm ail's em ail address schem e is quit e flexible. Not only can you receive em ails t o bot h j ohndoe@gm ail.com and j ohndoe@googlem ail.com , but you can also put a dot anywhere at all, or nowhere, as in j ohn.doe@gm ail.com , j .ohndoe@gm ail.com , or j ohndoe@gm ail.com ( well, if your nam e is indeed John Doe, t hat is; please replace accordingly) . As usual wit h em ail addresses, t hey are case- insensit ive t oo, so you can writ e [email protected] , t oo. All t hose em ails will reach t he sam e inbox—yours. There's anot her way t o form t he em ail address t hough, and it 's perhaps t he m ost useful. You can add a plus along wit h a keyword t o your em ail nam e. Like t he following exam ples: [email protected] [email protected] [email protected]

    These addresses will all be sent t o your norm al Gm ail inbox. This can com e in very handy if you want t o hand out separat e em ail addresses for separat e needs: perhaps one address for your office colleagues or your boss, anot her address for public m ailing list s, one for regist ering at web sit es you don't know t hat well, and yet anot her one for fam ily m em bers.

    Alt hough you can receive em ails cont aining dot s anywhere, when you log in t o your Gm ail account you st ill need t o provide t he dot s exact ly where you put t hem ( if you included any) during your init ial account signup.

    Once you separat e your em ails wit h t hese keywords, you can go ahead and filt er [ Hack # 44] incom ing m ail accordingly. Just go t o Gm ail and click t he " Creat e a filt er" link on t op. Then in t he To: field, ent er t he address you've handed out , as pict ured in Figure 5- 40, and click Next St ep. You can t hen select t he Skip t he I nbox field and choose Apply t he Label, creat ing a new label by t he nam e " Job," as shown in Figure 5- 41. Click Creat e Filt er t o confirm . Now, whenever you get a new m ail sent out t o j ohndoe+ j ob@gm ail.com ( j ohndoe being your chosen usernam e, and j ob being t he keyword of choice) , it will be aut om at ically sort ed int o t he Job folder/ label which you can access from t he bot t om left of Gm ail.

    Se t t in g u p t h e filt e r by pr ovidin g a spe cia l To: a ddr e ss

    Cr e a t in g a n e w la be l " Job" t o filt e r spe cific m a ils

    H a ck 5 4 . Se a r ch for a Spe cific La n gu a ge Som et im es Google releases undocum ent ed feat ures. At t he t im e of t his writ ing, Gm ail's lang operat or is one such undocum ent ed feat ure—but t hat shouldn't st op you from using it ! Gm ail.com has a hidden search feat ure allowing you t o find m essages in one language only. The operat or at hand is used in web searching, t oo: " lang" , as in t he following searches ( which find Germ an, French, and I t alian m essages, respect ively) : lang:de lang:fr lang:it

    I f you search for " lang: de" for inst ance ( no quot es) , you will see all your m essages in Germ an. Not e t hat t he labeling m ight not always be 100% accurat e. You can also com bine your language- rest rict ed search wit h a norm al keyword query, such as: lang:de zahlung

    N OTE You can also com bine t he language operat or wit h filt ers [ Hack # 44] .

    I f you are unsure about what abbreviat ion t o use for a given language, Google's advanced search dialog (ht t p: / / google.com / advanced_search ) can help. I n t he select box next t o t he " Ret urn pages writ t en in" label, choose any language. I 'm picking Arabic, as shown in Figure 5- 42. Also, ent er a keyword at t he t op, and t hen hit t he Google Search but t on. I n t he URL now showing in your browser, t here's a param et er nam ed " lr" wit h a value like " lang_ar "—t he last t wo let t ers are t he abbreviat ion you need t o search in Gm ail, such as lang: ar.

    N OTE Hat t ip t o Alan/ Garet t Rogers at Googling Google, ht t p: / / blogs.zdnet .com / Google/

    Google 's a dva n ce d se a r ch dia log ca n h e lp you fin d la n gu a ge a bbr e via t ion s

    H a ck 5 5 . Lin k t o Con ve r sa t ion s, Se a r ch e s, La be ls, a n d M or e Use t he power of Gm ail's perm alinks. Many of t oday's web applicat ions are opt im ized t o dynam ically load new cont ent int o t he current page you're on inst ead of forwarding you t o anot her page. This fix can offer fast er loading t im es, but it oft en com es wit h a problem : your browser's back but t on won't work t he way you expect it t o, and if you creat e a bookm ark, it usually brings you t o t he m ain page rat her t han t he cont ent you were int erest ed in. Gm ail.com offers a m ore accessible version of t he default service, which you can swit ch t o by choosing t he foot er link reading " basic HTML." This service not only uses an int erface wit h fewer feat ures, but behaves m ore like a t radit ional web applicat ion in m any respect s. But even in it s default version—a dynam ic web applicat ion—Gm ail allows you t o use t he URL shown in your browser's locat ion bar t o link t o specific cont ent . Lin k in g t o Spe cific Con ve r sa t ion s For inst ance, when you open a conversat ion t hread in Gm ail, t he locat ion bar cont ains a URL sim ilar t o t his one: http://mail.google.com/mail/#inbox/11623a4bda0eea2f

    I m agine t hat you're em ailing about an upcom ing event wit h your friend, and you now want t o add t his inform at ion t o Google Calendar. I nst ead of copying all t he det ails int o t he Calendar event descript ion m anually, you can now j ust add t he URL of t he t hread, and click t hrough t o t he conversat ion det ails when you need m ore inform at ion.

    N OTE Not e t hat your friends, even t hough t hey t ook part in t he sam e conversat ion t hread, can't follow t he link you are seeing in Gm ail—it 's a URL useful only t o you ( it leads t o a conversat ion wit hin your Gm ail account ) , so it m akes m ost sense t o use it only in privat e cont ext s ( like an event you don't share wit h anyone) .

    Lin k in g t o Se a r ch e s t o Allow Ea sy Re t r ie va l of Th r e a ds

    CREATE BOOKMARK SHORTCUTS I f you're using Firefox as your default browser, you can also set up a special bookm ark keyword. Open t he Bookm ark m enu, find your j ob bookm ark and right - click it t o open it s propert ies from t he cont ext m enu. I n t he Keyword box, ent er " j ob" , as shown in Figure 5- 43. Approve t he dialog by hit t ing t he OK but t on. Now whenever you ent er t he word " j ob" int o t he browser address bar in Firefox, you will be im m ediat ely t aken t o your m ails filt ered int o t he j ob label/ folder. You can use t his t rick wit h any bookm ark.

    You can also link t o searches. A search for " horses," for inst ance, generat es t he following address: http://mail.google.com/mail/#search/horses

    This, t oo, can be useful—like when you want t o point a friend t o a specific conversat ion t hat t he t wo of you had. You can now pick som e rat her dist inct words or a phrase from t he m essage ( such as " John, at t ached find t he m eet ing det ails" ) , search for it , and copy t he generat ed URL t o send it t o your friend or colleague. They will now be able t o easily ret rieve t he t hread you are referring t o, assum ing t hat t hey are also using Gm ail, and t hat t hey haven't delet ed t he m essage. Lin k in g t o La be ls You can also link t o specific labels t hat you've set up. Let 's say one of your labels is called " j ob," for all j obrelat ed m ails. Clicking on t he label link will t ake you t o a page wit h t he following URL, which you can bookm ark for lat er reference: http://mail.google.com/mail/#label/job

    Cr e a t in g a " Com pose " Sh or t cu t Anot her way t o use Gm ail's perm alink- st yle URLs is t o add a short cut for com posing a new m ail t o t he browser t oolbar ( t he t erm " perm alink" com es from t he world of blogs, t hough not e t hat not all Gm ail URLs are necessarily quit e as perm anent ) . For inst ance, in I nt ernet Explorer, it 's t he Links bar; in Firefox, it 's called t he Bookm arks Toolbar. I n Safari, t he nam e is Bookm arks Bar. The address for com posing a new m ail is: http://mail.google.com/mail/#compose

    Go t o t hat link, t hen drag and drop t he URL ont o your bookm arks t oolbar. Renam e t he link t it le t o som et hing short er, like " Com pose m ail." Now when you click it , as shown in Figure 5- 44, you will inst ant ly open a new Gm ail com pose window.

    Th e Fir e fox book m a r k pr ope r t ie s dia log

    Follow in g a " Com pose m a il" t oolba r sh or t cu t ( I r e a r r a n ge d t h e t oolba r la you t in Fir e fox so t h e bu t t on s t a k e u p le ss spa ce )

    N OTE Curious about how t o save but t on space at t he t op of Firefox, as shown in Figure 5- 44? You m ight use a bookm arks t oolbar or t he Google Toolbar, but you can also m ove t he but t ons from t hose furt her up—t o t hen m ake t he bars disappear. Right - click a t oolbar and select Cust om ize from t he cont ext m enu. You will now be able t o m ove any but t on from a t oolbar ont o t he t op bar ( t o t he right side of t he Firefox m enu) via drag and drop. Once finished, click t he Done but t on. Now right - click a t oolbar again and uncheck it in t he cont ext m enu t o m ake it disappear.

    H a ck 5 6 . Be yon d Google : Ya h oo! M a il, M S H ot m a il, a n d M or e I s Gm ail get t ing on your nerves, for som e reason or ot her? Well, it 's not t he only web m ail applicat ion out t here, so you m ight find yourself giving Google's com pet it ion a t ry, t oo. Two of t he m ost popular free em ail client s out t here are Yahoo! Mail and Microsoft Windows Live Hot m ail, t he successor t o Hot m ail. You m ay also prefer a deskt op m ail client , like Thunderbird, t o t he web- based kind.

    N OTE Swit ching web em ail client s is t he easiest when you have an address like yournam [email protected] which m erely forwards t o your web m ail client address, like your Gm ail address. I f you have your own host ing provider t hen you can usually log in t o t he host ing provider's cont rol panel t o set up addresses like t hese ( please consult your host ing support or help files for t he det ails) . I f you don't yet have one, you can t ry t o search Google for " get dom ain" , " web host ing" and sim ilar t o find a service.

    Once you set up your em ail adress t his way, you don't need t o hand out a new address t o friends and colleagues whenever you swit ch t o anot her em ail applicat ion. I n t he Gm ail set t ings Account s t ab, you can also change your Reply- To address t o e.g. "yournam e@exam ple.com " , m eaning ot her people will never reply direct ly t o t he Gm ail address. This adds an ext ra layer of flexibilit y. Once you set up your em ail adress t his way, you don't need t o hand out a new address t o friends and colleagues whenever you swit ch t o anot her em ail applicat ion. I n t he Account s t ab under Gm ail set t ings, you can also change your Reply- To address t o yournam e@exam ple.com , so t hat ot her people will never reply direct ly t o t he Gm ail address. This adds an ext ra layer of flexibilit y. Ya h oo! M a il Yahoo's em ail offering is especially t em pt ing if you're used t o deskt op program s like Microsoft Out look or Out look Express, as it shares som e of t he look and feel of t hese applicat ions. To sign up for Yahoo! Mail, visit ht t p: / / m ail.yahoo.com . I f you don't already have a Yahoo! I D, click t he " Sign up" but t on t o creat e one. You will be required t o pick a usernam e and password, provide your first and last nam e, gender, and m ore. Your em ail will end up being of t he form at YourUserNam [email protected] . Aft er logging in t o your m ail account , you will be greet ed wit h a page collect ing news, calendar event s, and special m essages and advert isem ent s, as shown in Figure 5- 45. I f you swit ch t o your inbox, you will find t hat you can drag and drop m essages int o t he t rash in t he left hand navigat ion pane. You will also not ice t hat m essages you open will show in a new t ab wit hin t he browser. M icr osoft H ot m a il Hot m ail—or Windows Live Hot m ail, as it 's fully t it led—can be reached at ht t p: / / hot m ail.com . Sign up for an account if you don't have one already; not e t hat you can also use an MSN Messenger or Passport account as your so- called Windows Live I D for t his purpose. Sign in wit h your usernam e and password. As opposed t o Gm ail and Yahoo Mail, you need t o provide your full em ail address during login ( for exam ple, YourUserNam e@hot m ail.com inst ead of j ust YourUserNam e) . Aft er signing in t o Hot m ail, t he program opens wit h an int ro page cont aining news, m iscellaneous inform at ion, and ads, as pict ured in Figure 5- 46, but you can access your inbox by following t he link t o t he left . Hot m ail also offers a calendar applicat ion and an address book. As wit h Gm ail, t he am ount of em ail st orage varies over t im e, but at t he t im e of t his writ ing, Hot m ail offered 5 GB. Furt herm ore, Hot m ail allows you t o swit ch t he int erface t hem e [ Hack # 47] via t he Opt ions m enu.

    Ya h oo! M a il h a s t h e look a n d fe e l of a de sk t op a pplica t ion

    W e lcom e t o H ot m a il!

    M ozilla Th u n de r bir d Thunderbird is t he sibling of t he Firefox browser, wit h a focus on handling em ail inst ead of web pages. Pict ured in Figure 5- 47, it 's a lean " offline" client t hat you can download at ht t p: / / m ozilla.com / t hunderbird/ and inst all for free [ Hack # 48] —and even use t o access your Gm ail em ail, if you want t o, using POP or I MAP [ Hack # 52] .

    Th e Th u n de r bir d e m a il in box

    CUSTOM I ZE YOUR GOOGLE H OM E PAGE iGoogle is t h e n a m e of Google 's pe r son a lize d h om e pa ge , w h ich you ca n r e a ch by click in g " iGoogle " on t h e Google h om e pa ge , or by goin g st r a igh t t o h t t p:/ / igoogle .com . iGoogle is n ot a sin gle fe a t u r e of t h e Google h om e pa ge ; r a t h e r , it 's a n a lt e r n a t ive fla vor of it , displa yin g a va r ie t y of so- ca lle d " ga dge t s," a s sh ow n in Figure 6- 1. I f you like t he sim plicit y of t he current Google hom e page, you don't need t o swit ch. But if you're looking for ways t o add m ore spice t o Google, consider t he m ove—and you can also swit ch bet ween t he t wo flavors, depending on what you need t o do. You will t hen be able t o see weat her gadget s, int eract ive m aps, m iniat ure versions of special search engines, your Gm ail inbox, and m uch m ore, right on Google.com . You can set your own background im age for Google as well. To use iGoogle fully, you need a Google account ( see Chapt er 1 ) . This way you will be able t o add your own t abs and gadget s. An iGoogle t ab is j ust a collect ion of m ult iple gadget s, and you can add several different t abs. A gadget , on t he ot her hand, is . . . anyt hing really. Think of it as a web page or web applicat ion but in m iniat ure form .

    iGoogle : you r cu st om ize d a n d w idge t ize d ve r sion of t h e Google h om e pa ge

    Here's a short overview of t he kind of gadget s available t oday in t he Google gadget direct ory—from lit t le helpers and applicat ions t o gam es, from t he very useful t o t he m erely ent ert aining, and everyt hing in bet ween:

    Weat her forecast s for your locat ion

    A Wikipedia search box, rest rict ing result s t o pages from t his large, hum an- edit ed online encyclopedia

    A colorful box showing t he current dat e and t im e

    The Einst ein quot e of t he day, or t he Jon St ewart quot e of t he day

    Brain t easers t o st art your day

    Your own ToDo list

    A search box for a dict ionary or t hesaurus

    An inform at ion box showing your I P address

    Your Google Calendar event s for t he m ont h

    The Buddhist t hought of t he day, or a paint ing m ast erpiece of t he day

    A " falling blocks" - st yle puzzle gam e, playable right wit hin your browser

    The t op st ories from Google News

    A count down t icker for your birt hday ( or New Year's Day)

    A Mario- st yle j um p- and- run gam e, or a Pac- Man- like m aze gam e

    Hot m ail or Yahoo! Mail

    The Garfield or Dilbert cart oon of t he day

    An eBay t racker t o wat ch out for bargains for you

    Google Talk, so you can chat wit h ot hers right from Google.com

    A m arket sum m ary, court esy of Google Finance, or a st ock chart of your choice

    The lat est headlines from CNN.com , Reut ers, ESPN, Tim e, or FOX

    The lat est headlines from any RSS- enabled blog or news sit e of your choice

    and m uch m ore! Behind each of t hese gadget s is an XML file cont aining HTML, CSS, and JavaScript defining what t he gadget

    should do; how it react s t o your input , which dat a sources it is supposed t o pull, and which preferences you set for t his gadget . A gadget can also sim ply refer t o anot her web sit e, whose cont ent s are int egrat ed int o your Google hom e page. Also, gadget s can com m unicat e wit h each ot her using gadget - t o- gadget com m unicat ion. You can creat e your own gadget s, t oo, wit h no, lit t le, or lot s of program m ing—what ever you prefer. So wit hout furt her ado, let 's t ake a look at how t o hack t he Google hom e page using iGoogle as well as how t o hack iGoogle it self ( by going beyond it s nat ive scope of feat ures) .

    Som e older gadget s m ay require you t o " inline" t hem . An inlined gadget has access t o m ore of your Google set t ings t han regular gadget s. When it com es t o gadget s t hat require inlining, only add t hose you consider safe and t rust wort hy. I n general, however, inlining is not required in t he first place; what 's m ore, Google deprecat ed t he inlining feat ure, so gadget s developed t hese days cannot use inlining.

    GOOGLE DESKTOP Som e Google gadget s—t he so- called universal gadget s—also run on t he deskt op inst ead of t he browser, as part of Google Deskt op ( and as a side- not e, som e gadget s also run in social net works like Orkut , by way of Google's OpenSocial library) . The Google Deskt op set up is available for Windows Vist a/ 2000/ XP, Mac OS X 10.4+ , and Linux, and can be downloaded from ht t p: / / deskt op.google.com . Google Deskt op offers m ore t han gadget s: it also let s you search your com put er, or bring up a quick search box for t he Web when you hit t he Ct rl/ Com m and key t wice. I f you want gadget s on your deskt op, but don't need all of Google Deskt op, look int o Am nest y Generat or (ht t p: / / www.am nest ywidget s.com ) , which can convert Google Gadget s int o Mac OS X Dashboard widget s or Windows Vist a Sidebar gadget s. Also, Mac OS X users can choose t o download j ust t he port ion of Google Deskt op t hat em beds gadget s in Dashboard ( click " Choose your own feat ures" on t he download page.)

    H a ck 5 7 . Add Google Tools t o iGoogle You can search for new cont ent or browse t he Google direct ory, adding individual gadget s as you com e across t hem . But you can also add several gadget s all at once. The iGoogle hom e page ( ht t p: / / igoogle.com ) is t he perfect place t o organize your Google apps suit e, like Google Calendar, Gm ail, Google Reader, or Google Docs. I t offers helper gadget s t hat showcase your inbox, your calendar event s, and your current docum ent s. You can go t o iGoogle and click " Add st uff" t o search for t hese Google gadget s one by one, or you can add t he whole lot of t hem in one sem iaut om at ed swift swoop. To aut om at ically add t hese gadget s, click on " Add a t ab" on t op. I nside t he dialog t hat shows up, ent er t he t ab nam e " Google Tools" . Keep t he " I 'm feeling lucky" checkbox select ed when pressing OK. Aft er a few seconds, you will end up wit h a new t ab collect ing all kinds of gadget s. Because t his select ion is aut om at ed, it m ay not be exact ly what you require. At t his t im e, som e of t he useful gadget s t hat are added were ( t his m ay change in t he fut ure) :

    Google Reader, t o keep up on your RSS subscript ions

    Google Talk, t o chat wit h friends, fam ily, and colleagues

    Google Not ebook for writ ing down sm aller not es [ Hack # 14]

    A Google Maps search

    A ToDo List

    Google Groups ( if you are a m em ber of any)

    A Google Docs files overview

    Google Docs

    Gm ail

    But som e of t he gadget s m ay not be useful t o you, and som e t hat you m ay find useful are probably m issing. To fine- t une Google's preselect ion, go ahead and rem ove all t hose gadget s t hat you do not want by clicking t he " x" but t on of each. For inst ance, I rem oved t he ToDo list and Google Groups gadget s, am ong ot hers. Now select " Add st uff" and look for ot hers, and especially t hese gadget s:

    Search for " Google Bookm arks" t o get t he official Google bookm arks gadget .

    Search for " Picasa Web Phot os" t o display your Picasa phot os.

    Search for " Google News cust om ized" t o get t he lat est headlines for your t opic of choice; for inst ance, I 've ent ered " Yahoo" . You can pick any t opic you like t o t rack for your j ob proj ect or your personal int erest .

    Once you've added t hese, you can also change your t ab layout . Click t he arrow icon next t o your t ab nam e " Google Office," and choose " Edit t his t ab." Select a new layout from t he list of opt ions for a result as shown in Figure 6- 2. To save you t he t im e it t akes t o add t hese gadget s, you can also j ust int egrat e t he shared t ab we provide at ht t p: / / blogoscoped.com / googleappshacks/ link/ apps- t ab. ( To share a cust om t ab of your own, select " Share t his t ab" from t he t ab m enu.)

    You r Google office h om e pa ge

    CUSTOM I ZE YOUR GOOGLE H OM E PAGE iGoogle is t h e n a m e of Google 's pe r son a lize d h om e pa ge , w h ich you ca n r e a ch by click in g " iGoogle " on t h e Google h om e pa ge , or by goin g st r a igh t t o h t t p:/ / igoogle .com . iGoogle is n ot a sin gle fe a t u r e of t h e Google h om e pa ge ; r a t h e r , it 's a n a lt e r n a t ive fla vor of it , displa yin g a va r ie t y of so- ca lle d " ga dge t s," a s sh ow n in Figure 6- 1. I f you like t he sim plicit y of t he current Google hom e page, you don't need t o swit ch. But if you're looking for ways t o add m ore spice t o Google, consider t he m ove—and you can also swit ch bet ween t he t wo flavors, depending on what you need t o do. You will t hen be able t o see weat her gadget s, int eract ive m aps, m iniat ure versions of special search engines, your Gm ail inbox, and m uch m ore, right on Google.com . You can set your own background im age for Google as well. To use iGoogle fully, you need a Google account ( see Chapt er 1 ) . This way you will be able t o add your own t abs and gadget s. An iGoogle t ab is j ust a collect ion of m ult iple gadget s, and you can add several different t abs. A gadget , on t he ot her hand, is . . . anyt hing really. Think of it as a web page or web applicat ion but in m iniat ure form .

    iGoogle : you r cu st om ize d a n d w idge t ize d ve r sion of t h e Google h om e pa ge

    Here's a short overview of t he kind of gadget s available t oday in t he Google gadget direct ory—from lit t le helpers and applicat ions t o gam es, from t he very useful t o t he m erely ent ert aining, and everyt hing in bet ween:

    Weat her forecast s for your locat ion

    A Wikipedia search box, rest rict ing result s t o pages from t his large, hum an- edit ed online encyclopedia

    A colorful box showing t he current dat e and t im e

    The Einst ein quot e of t he day, or t he Jon St ewart quot e of t he day

    Brain t easers t o st art your day

    Your own ToDo list

    A search box for a dict ionary or t hesaurus

    An inform at ion box showing your I P address

    Your Google Calendar event s for t he m ont h

    The Buddhist t hought of t he day, or a paint ing m ast erpiece of t he day

    A " falling blocks" - st yle puzzle gam e, playable right wit hin your browser

    The t op st ories from Google News

    A count down t icker for your birt hday ( or New Year's Day)

    A Mario- st yle j um p- and- run gam e, or a Pac- Man- like m aze gam e

    Hot m ail or Yahoo! Mail

    The Garfield or Dilbert cart oon of t he day

    An eBay t racker t o wat ch out for bargains for you

    Google Talk, so you can chat wit h ot hers right from Google.com

    A m arket sum m ary, court esy of Google Finance, or a st ock chart of your choice

    The lat est headlines from CNN.com , Reut ers, ESPN, Tim e, or FOX

    The lat est headlines from any RSS- enabled blog or news sit e of your choice

    and m uch m ore! Behind each of t hese gadget s is an XML file cont aining HTML, CSS, and JavaScript defining what t he gadget

    should do; how it react s t o your input , which dat a sources it is supposed t o pull, and which preferences you set for t his gadget . A gadget can also sim ply refer t o anot her web sit e, whose cont ent s are int egrat ed int o your Google hom e page. Also, gadget s can com m unicat e wit h each ot her using gadget - t o- gadget com m unicat ion. You can creat e your own gadget s, t oo, wit h no, lit t le, or lot s of program m ing—what ever you prefer. So wit hout furt her ado, let 's t ake a look at how t o hack t he Google hom e page using iGoogle as well as how t o hack iGoogle it self ( by going beyond it s nat ive scope of feat ures) .

    Som e older gadget s m ay require you t o " inline" t hem . An inlined gadget has access t o m ore of your Google set t ings t han regular gadget s. When it com es t o gadget s t hat require inlining, only add t hose you consider safe and t rust wort hy. I n general, however, inlining is not required in t he first place; what 's m ore, Google deprecat ed t he inlining feat ure, so gadget s developed t hese days cannot use inlining.

    GOOGLE DESKTOP Som e Google gadget s—t he so- called universal gadget s—also run on t he deskt op inst ead of t he browser, as part of Google Deskt op ( and as a side- not e, som e gadget s also run in social net works like Orkut , by way of Google's OpenSocial library) . The Google Deskt op set up is available for Windows Vist a/ 2000/ XP, Mac OS X 10.4+ , and Linux, and can be downloaded from ht t p: / / deskt op.google.com . Google Deskt op offers m ore t han gadget s: it also let s you search your com put er, or bring up a quick search box for t he Web when you hit t he Ct rl/ Com m and key t wice. I f you want gadget s on your deskt op, but don't need all of Google Deskt op, look int o Am nest y Generat or (ht t p: / / www.am nest ywidget s.com ) , which can convert Google Gadget s int o Mac OS X Dashboard widget s or Windows Vist a Sidebar gadget s. Also, Mac OS X users can choose t o download j ust t he port ion of Google Deskt op t hat em beds gadget s in Dashboard ( click " Choose your own feat ures" on t he download page.)

    H a ck 5 7 . Add Google Tools t o iGoogle You can search for new cont ent or browse t he Google direct ory, adding individual gadget s as you com e across t hem . But you can also add several gadget s all at once. The iGoogle hom e page ( ht t p: / / igoogle.com ) is t he perfect place t o organize your Google apps suit e, like Google Calendar, Gm ail, Google Reader, or Google Docs. I t offers helper gadget s t hat showcase your inbox, your calendar event s, and your current docum ent s. You can go t o iGoogle and click " Add st uff" t o search for t hese Google gadget s one by one, or you can add t he whole lot of t hem in one sem iaut om at ed swift swoop. To aut om at ically add t hese gadget s, click on " Add a t ab" on t op. I nside t he dialog t hat shows up, ent er t he t ab nam e " Google Tools" . Keep t he " I 'm feeling lucky" checkbox select ed when pressing OK. Aft er a few seconds, you will end up wit h a new t ab collect ing all kinds of gadget s. Because t his select ion is aut om at ed, it m ay not be exact ly what you require. At t his t im e, som e of t he useful gadget s t hat are added were ( t his m ay change in t he fut ure) :

    Google Reader, t o keep up on your RSS subscript ions

    Google Talk, t o chat wit h friends, fam ily, and colleagues

    Google Not ebook for writ ing down sm aller not es [ Hack # 14]

    A Google Maps search

    A ToDo List

    Google Groups ( if you are a m em ber of any)

    A Google Docs files overview

    Google Docs

    Gm ail

    But som e of t he gadget s m ay not be useful t o you, and som e t hat you m ay find useful are probably m issing. To fine- t une Google's preselect ion, go ahead and rem ove all t hose gadget s t hat you do not want by clicking t he " x" but t on of each. For inst ance, I rem oved t he ToDo list and Google Groups gadget s, am ong ot hers. Now select " Add st uff" and look for ot hers, and especially t hese gadget s:

    Search for " Google Bookm arks" t o get t he official Google bookm arks gadget .

    Search for " Picasa Web Phot os" t o display your Picasa phot os.

    Search for " Google News cust om ized" t o get t he lat est headlines for your t opic of choice; for inst ance, I 've ent ered " Yahoo" . You can pick any t opic you like t o t rack for your j ob proj ect or your personal int erest .

    Once you've added t hese, you can also change your t ab layout . Click t he arrow icon next t o your t ab nam e " Google Office," and choose " Edit t his t ab." Select a new layout from t he list of opt ions for a result as shown in Figure 6- 2. To save you t he t im e it t akes t o add t hese gadget s, you can also j ust int egrat e t he shared t ab we provide at ht t p: / / blogoscoped.com / googleappshacks/ link/ apps- t ab. ( To share a cust om t ab of your own, select " Share t his t ab" from t he t ab m enu.)

    You r Google office h om e pa ge

    H a ck 5 8 . Ch a t fr om iGoogle You don't need t o leave your seat , or t he Google hom e page, t o t alk t o ot hers. Google offers different t ools for you t o chat wit h your friends or colleagues. Am ong t hem are:

    1 . The Google Talk client , a deskt op applicat ion. This requires you t o download and inst all a file from ht t p: / / google.com / t alk. At t he t im e of t his writ ing, it 's t he only variant of Google Talk t hat is voiceenabled, allows file t ransfers, and not ifies you when you receive new m ail in Gm ail.

    2 . The web- based Google Chat program , int egrat ed wit h Gm ail (ht t p: / / gm ail.com ) .

    3 . The Google Talk web page. You can launch a new chat window at ht t p: / / google.com / t alk.

    4 . The Google Talk web page gadget . St art ing off at ht t p: / / igoogle.com , you can add t he gadget t o your personalized Google hom e page.

    One of t he easiest ways t o chat is t o use t he st andalone web version of Google Talk, eit her running in it s own window or as a gadget . To add t he gadget , click t he " Add st uff" link at t he t op of iGoogle. Search for " Google Talk" and choose t he official Google Talk gadget ( it will say " By Google" ) . Click " Add it now" and your iGoogle page now cont ains an inst ant m essenger, as shown in Figure 6- 3. To get st art ed, sim ply ent er your friend's Gm ail address int o t he t op box. They m ay not appear in t he list unt il t hey've confirm ed you as a cont act . Chat t ing is now as easy as t yping som et hing and hit t ing Ret urn, as you would do in any ot her inst ant m essenger client . There are a num ber of special sym bols, so called em ot icons or sm ileys, t hat you can t ype t o display a graphic icon t o your friend: :D =) :) =D

    Smile Smile Smile Smile

    Th e Google Ta lk ga dge t on iGoogle

    :-) ;) ;-) :-0 x-( B-) :'( :-| :-/ :p

    The XML declarat ion on t op defines t he charact er set , UTF- 8 [ Hack # 12] . The root elem ent is called Module, as gadget s were previously ( and st ill occasionally are) called " m odules" by Google. The ModulePrefs elem ent st ores your set t ings for t his gadget , such as it s t it le; a UserPref elem ent , not shown in t his short exam ple, can st ore t he cust om user set t ings. The act ual cont ent of your m odule is t he HTML sect ion, wrapped wit hin t he CDATA part .

    Change t he cont ent from " Hello, world! " t o anyt hing else, and include som e sim ple ( X) HTML, like t he following: ...

    Hello world, this is my first gadget!

    ]]> ...

    Th e Google Ga dge t Edit or , a lon g w it h t h e " M y Ga dge t s" ga dge t , h e lps you w it h t h e de ve lopm e n t pr oce ss

    Preview t he gadget , and if you like t he result s, save it by select ing File Save As from t he edit or gadget m enu. You can opt t o use Google's host ing solut ion for t his. Choose any filenam e for your sam ple, like hello2.xml. You will see t his filenam e displayed in t he t op right of your edit or. Click t he link t o open t he URL in a new window, and t he address m ay look sim ilar t o t he following: Code View: http://hosting.gmodules.com/ig/gadgets/file/122710312740571178902/hello2.xml

    Copy t he address you are seeing and past e it int o t he box wit hin t he developer helper gadget ( t he gadget t it led " My Gadget s" ) . Clicking t he Add but t on will now show your gadget on t he iGoogle page. At t his point , you can share t he gadget wit h anyone else, or read t hrough Google's t ut orial at ht t p: / / google.com / apis/ gadget s/ docshom e.ht m l t o find out m ore about t he gadget synt ax. You can also load furt her sam ples int o t he gadget edit or t o see what t hey are m ade of. To do so, select New from t he Google Gadget Edit or's File m enu.

    I f you choose Google's gadget host ing, not e t hat all your saved files will share t he sam e folder, and som eone knowing t he folder nam e m ay be able t o guess your filenam e. I t is advisable t o not publish anyt hing wit hin your gadget t hat you wouldn't want t he world t o see. Google does not declare any HTML docum ent t ype when rendering gadget s t o t he browser. Alt hough you can im plicit ly use XHTML or HTML ( St rict or Transit ional) in your gadget , t he lack of doct ype m akes som e browsers swit ch t o a so- called " quirks m ode." This m ay bring wit h it som e subt le differences in regards t o how CSS is displayed, am ong ot her issues.

    Th e D a ily Pr odu ct I m a ge Ga dge t Suppose t hat you want t o creat e a gadget t hat displays a different im age from your product dat abase every day. Not e t his sect ion requires a basic underst anding of t he t echnologies involved—t he gadget synt ax, Apache/ PHP/ MySQL, CSS, and XHTML—and gives j ust a broad overview of how you can put t he individual pieces t oget her. The first choice you face when deciding how t o set up your gadget is whet her t o em bed your code in t he gadget XML, or j ust have t he XML point t o a page on your server. The form er approach has t he benefit of using t he Google gadget fram ework's nat ive caching capabilit ies. Google polls your XML definit ion every once in a while but t hen serves it from t heir own servers t o gadget users, saving you bandwidt h. This hack uses code em bedded in an XML file inst ead of a point er t o your webpage. I f your hypot het ical dat abase t able " product s" has t he fields id, t it le, price, and im age, t hen you could creat e a second t able " product s_random " wit h t he fields id, product _id, and dat e and fill it once wit h product im age I Ds using a script , or add t o it daily using a cron j ob on your server. Please not e t hat if you're not com fort able wit h using a SQL server t able, an alt ernat ive approach t o define t he product dat a is list ed short ly as well. Whet her you are using SQL or not , t he PHP file t o show t he daily im age is as follows:



    I f you'd rat her not use SQL for now, you can also use a funct ion t hat st ores your product dat a in an array. I n t he following code, several cover im age I Ds from t he O'Reilly cat alog are list ed. Using t he day() funct ion, you get a num ber represent ing t he day of t he year—0 for January 1, 42 for February 12, and so on. The m odulus operat or ( % ) now gives you t he rem ainder of dayOfYear divided by t he am ount of covers available. This coverIndex num ber can be used t o grab a specific cover I D—for every new day a different num ber is picked ( rot at ing back t o t he beginning of t he array if no m ore new covers are available) :

    As you can see in t hese exam ple funct ions, t he ret urned im age URL is an absolut e URL; t hat 's because even t hough t he XML is init ially host ed on your server, it will lat er be served by Google t hrough t he gm odules.com dom ain. I n order t o have your script be recognized by your web server as a PHP script , you will probably need t o give it a filenam e such as product - gadget .php. I f you are using t he Apache server wit h mod_rewrite enabled, you can m ake it look like an XML file by using synt ax like t he following inside an .ht access file on your server:

    RewriteEngine On RewriteRule ^product-gadget\.xml

    product-gadget.php

    This would let you use a URL like ht t p: / / exam ple.com / product - gadget .xm l. Your gadget is now ready t o be subm it t ed at ht t p: / / google.com / ig/ subm it !

    N OTE Not e t hat an alt ernat ive t o t his approach is t o have your product im age script em it an RSS/ At om feed, as iGoogle users can also add any feed as a gadget . This way, you would also support RSS readers, RSSenabled screensavers, and m obile devices t hat support RSS.

    H a ck 6 1 . Cr e a t e a n iGoogle Th e m e I s t he plain whit e background of t he Google hom e page boring you? When you click t he Select Them e link at iGoogle.com , you are forwarded t o t he t hem es direct ory t o pick one of t he m any available looks for your Google hom e page. You'll find choices like Lollipopland, Hong Kong ( pict ured in Figure 6- 10) , or Dart s. Som e of t he t hem es are provided by Google; ot hers are hom ebrewed. Cert ain t hem es will also change wit h t he t im e of t he day, and m ay include East er eggs—special surprises showing at specific t im es of t he day.

    N OTE Pssst : not keen on wait ing for hours on end t o glance at t he East er eggs? Take a look at UK developer Tony Ruscoe's hack t o m ake t hem appear inst ant ly at ht t p: / / ruscoe.net / blog/ 2007/ 03/ googlepersonalized- hom epage- east er.asp.

    I f you want t o creat e your own t hem e, Google has a det ailed one- st op t ut orial t o t he Them es API for you at ht t p: / / code.google.com / apis/ t hem es/ docs/ dev_guide.ht m l. Basically, each t hem e consist s of an XML file t hat list s different " skins," which define t hings like link colors, t ext colors, and background im ages. ( Not e t hat alt hough you can choose bet ween t he different available iGoogle logos, you are not allowed t o com plet ely rem ove t he logo.) igTh e m e r Even m ore direct t han going t hrough t he Google t ut orial t o develop a t hem e is t o use igThem er. Available at ht t p: / / hawidu.com / t hem es/ , t his t hird- part y t ool present s a form list ing t he various available opt ions. I 've clicked on t he color picker for t he header background, for inst ance, and aft er m aking a select ion, pressed t he Refresh but t on at t he t op of t he form . This result ed in t he look shown in Figure 6- 11. Hit t he Creat e but t on at t he end of t he form when you're done cust om izing, and igThem er will host t he XML for you at a URL sim ilar t o t his one: ht t p: / / hawidu.com / t hem es/ public/ t hem e021208093859.xm l. Th e iGoogle Th e m e Edit or Book m a r k le t Anot her very int erest ing opt ion for t hem e creat ion is t he bookm arklet developed by Japan's Yoshiom i Kurisi, at ht t p: / / chris4403.blogspot .com ( t hanks t o I onut of ht t p: / / googlesyst em .blogspot .com for suggest ing t his hack) . A bookm arklet is a short piece of JavaScript , st ored as a browser bookm ark, t hat you can execut e on any web page [ Hack # 16] .

    Google 's H on g Kon g t h e m e for iGoogle pa in t s t h e ba ck gr ou n d a s cit ysca pe

    igTh e m e r t a k e s you t h r ou gh cr e a t in g a n iGoogle t h e m e

    To get st art ed, creat e a bookm ark from t he Edit iGoogle Them e link found at ht t p: / / blogoscoped.com / googleappshacks/ bookm arklet s.ht m l. This is t he code behind t he bookm ark address, if you're int erest ed ( t hough you do not need t o underst and t he code t o use it ) : Code View: javascript:var s=document.createElement('script');s.id="igteid";

    s.type="text/javascript";s.src= "http://igoogle-theme-editor.googlecode.com/svn/" +"trunk/iGoogleThemeEditor/dist/ige.js?lang=en&" +new Date().getTime(); document.body.appendChild(s);void(0);

    Now click t his bookm arklet while at iGoogle.com t o bring up a neat WYSI WYG edit or, as shown in Figure 6- 12. Expand t he dialog's groups, like Header Area, t o adj ust specific values. Click Creat e XML if you like t he result . You can now copy t he code out of t he t ext box t hat com es wit h t he dialog, and past e it int o som ewhere m ore perm anent . Not e t hat t he iGoogle Them e Edit or, unlike igThem er, does not do t he host ing for you. I f you don't have your own server, one way t o st ore t he XML is t o copy and past e it int o t he Google Gadget Edit or [ Hack # 60] , t hen click File Save As from it s m enu. The result ing public URL will be sim ilar t o t his one: ht t p: / / host ing.gm odules.com / ig/ gadget s/ file/ 11545685120703182/ m yt hem e.xm l. To t est t he st ored t hem e, go t o iGoogle.com and append ?skin=YOUR- TH EM E- AD D RESS t o t he URL in t he browser address bar, as in t his snipped exam ple: ht t p: / / www.google.com / ig? skin= ht t p: / / host ing.gm odules.com / ig/ ...m yt hem e.xm l. Once your t hem e is creat ed, you can subm it it t o t he direct ory at ht t p: / / google.com / ig/ skin_subm it .

    Th e iGoogle t h e m e e dit or book m a r k le t in a ct ion

    H a ck 6 2 . Add Google N e w s t o iGoogle There's m ore ways t han one t o get Google News on iGoogle . . . in fact , t here are at least six. Google News ( ht t p: / / news.google.com ) is Google's m ainst ream news ( and part ially, blog) aggregat or. According t o a t est I conduct ed in 2006, over 10,000 select ed news sources are indexed in t he US version alone. News st ories from sit es t hat are part of Google News are oft en indexed wit hin m ere m inut es. By split t ing up various st ories int o cont ent clust ers, Google helps you t rack developm ent s of breaking news. There are different ways t o put Google News ont o your iGoogle hom e page. Following are explanat ions for each of t hem . To add one of t hese gadget s, go t o ht t p: / / igoogle.com and select Add st uff Add feed or gadget ; t hen past e in t he gadget 's XML URL.

    N OTE Have a blog you want t o subm it for inclusion in Google News? Try ht t p: / / www.google.com / support / news_pub/ bin/ request .py t o see whet her it will be accept ed by Google's edit ors. There's no guarant eed way t o get inside t he program , but it should be easier if you have m ult iple bloggers on board along wit h an edit or, t urning your blog int o m ore of a group effort at news, rat her t han a form of personal expression.

    Th e Ta bbe d Google N e w s Ga dge t You will find t his official Google gadget ( see Figure 6- 13) at : ht t p: / / www.google.com / ig/ m odules/ t abnews.xm l. Different t abs cat egorize news int o Top St ories, U.S., World, and m ore. You can also add your own cat egories via t he set t ings dialog, which you can access by clicking t he down- point ing arrow icon on t op of t he gadget . You can cust om ize how m any it em s are displayed per t ab and whet her t o show im age t hum bnails. You can also swit ch t o anot her count ry's version of Google News. A Cu st om RSS Fe e d On iGoogle, you can subscribe t o any RSS or At om feed, including t he ones offered by Google [ Hack # 77] . The URL for t he Google News feed is t he following, where " m ozart " needs t o be replaced by your own keyword or keywords ( use a + charact er as separat or) : ht t p: / / news.google.com / news?hl= en&ned= us&ie= UTF8&out put = rss&q= m ozart .

    N OTE Not e t hat t his gadget can be included on ot her web pages, t oo ( as is t he case wit h m any, but not all gadget s) . To do so, expand t he opt ions dialog by clicking t he arrow icon and select " About t his gadget ." On t he gadget page, follow t he " Em bed t his gadget " link and you'll see som e code t hat you can em bed in your web page.

    The result is a sim ple list of new it em s from t he feed, as pict ured in Figure 6- 14, where each it em can be expanded t o show it s snippet . You can also subscribe t o a cat egory rat her t han a search. Just use t he navigat ion t o t he left of t he Google News hom e page t o j um p t o a specific sect ion. Then, copy t he RSS feed from t here, like t he following ones:

    Business: ht t p: / / news.google.com / ?ned= us&t opic= b&out put = rss

    Ent ert ainm ent : ht t p: / / news.google.com / ?ned= us&t opic= e&out put = rss

    Th e W h ole Google N e w s H om e Pa ge When swit ching t o t he wide- colum n layout in your iGoogle t ab opt ions, you can even com fort ably include t he Google News hom e page it self—by wrapping it in an XML gadget . You can creat e such a wrapper from scrat ch [ Hack # 64] or use t he exist ing wrapper at t he following address, for a result as shown in Figure 6- 15: ht t p: / / blogoscoped.com / hom e page/ google- news- default .xm l.

    Th e t a bbe d Google N e w s ga dge t

    Th e Google N e w s RSS fe e d

    At fir st , t h e Google N e w s ga dge t w ill a sk you for a k e yph r a se

    Aft e r you 've pr ovide d t h e t opic, se ve r a l u p- t o- da t e st or y clu st e r s w ill a ppe a r

    Th e Google N e w s h om e pa ge it se lf, in clu de d a s a ga dge t

    Th e Google N e w s m obile ga dge t

    Th e n e w s r e com m e n da t ion w idge t a sk s you if you lik e a pa r t icu la r r e com m e n da t ion ; t h e blu e - on w h it e a r r ow bu t t on a t t h e t op r igh t a llow s you t o pa ge t h r ou gh t o t h e n e x t st or y

    Th e N on - Ta bbe d Google N e w s Ga dge t An older, but also official gadget ized version of t he Google News hom e page is available at t he following URL: ht t p: / / www.google.com / ig/ m odules/ built in_news_cust om ized.xm l. The gadget will show t hree st ories—or m ore, if you edit t he set t ings—on any chosen keyword, as shown in Figures 6- 16 and 6- 17. There are also a couple of t opic- specific st andalone gadget s available from Google, such as:

    Top st ories: ht t p: / / www.google.com / ig/ m odules/ built in_news_t opst ories.xm l

    Tech news: ht t p: / / www.google.com / ig/ m odules/ built in_news_t echnology.xm l

    Th e M obile Va r ia n t of Google N e w s Just as you can include t he full Google hom e page as described earlier, you can also include t he m obileopt im ized version ( pict ured in Figure 6- 18) . You can find a gadget wrapper for it at t he following address: ht t p: / / blogoscoped.com / hom e page/ google- news.xm l. Pe r son a lize d N e w s Re com m e n da t ion s Google also has a Recom m ended News gadget available for you. You can find it locat ed at : ht t p: / / www.google.com / ig/ m odules/ recom m endat ions/ recom m ended_news.xm l. This widget is t ailored t o your personal Google News usage. For inst ance, if you are searching for " classical com posers" a lot , t hen you m ight get a new recom m endat ion for a news st ory on Bach. Figure 6- 19 shows how t he gadget looks when I include it on m y page ( I 'm get t ing a st ory on Google I nc. because I read a lot about Google on Google News) .

    H a ck 6 3 . Em be d Con t e n t fr om An y W e b Sit e in a Ga dge t Fet ch cont ent from any ot her web sit e in near real t im e t o st ay up- t o- dat e on iGoogle. Som e sit es offer an API ( Applicat ion Program m ing I nt erface) for you t o grab t heir dat a. But using so- called screenscraping, you can grab alm ost any web sit e's cont ent —independent of whet her t he sit e offers an API t o developers. This hack com es in handy t o collect snippet s of inform at ion from dynam ically updat ed, inform at ionheavy web sit es. The iGoogle fram ework m akes fet ching web sit e cont ent very easy t hrough t he _IG_FetchContent() funct ion. This funct ion accept s t wo param et ers: one is t he URL t o be fet ched, and t he ot her is t he funct ion t o execut e when t he cont ent is ret urned. As an exam ple, let 's say you want t o m easure t he num ber of t im es blogs recent ly linked t o your com pany hom e page ( or your personal blog, or any ot her web sit e) . You can use t he Google Gadget Edit or t o creat e a new gadget [ Hack # 60] , as shown in Figure 6- 20. The first st ep is t o set up t he " skelet on" of your gadget , and include a " Loading" m essage:

    Loading...

    ]]>

    Scr ipt in g a n iGoogle m odu le u sin g t h e Google Ga dge t Edit or

    This way, unt il your script finishes, a " Loading. . . " m essage is displayed. Now go over t o Google Blog Search at ht t p: / / blogsearch.google.com , and perform a search t hat 's rest rict ed t o m ent ions from t he past week ( or day,

    or m ont h) while using t he " link: " operat or t o find links t o your sit e only. For inst ance, you can search for link: exam ple.com or link: blogoscoped.com , as shown in Figure 6- 21. Bet ween t he words " Result s 1 – 10 of" and " linking t o" t o t he t op right of Google Blog Search result s, you can see t he num ber of links t o t he blog. You can now fet ch t his value for t he gadget using a JavaScript block. I nsert t he following below t he line t hat reads "

    Loading...

    " :

    You can also go wit h t he following alt ernat ive. I nst ead of t he getTextBetween call, writ e: var blogCount = getMatch(response, " of ([^

    That 's quit e a bit of code. You will not ice t hat bot h an object and an em bed t ag are being used; t he redundancy is caused by t he need t o support different browsers. However you can sim plify t his port ion by " out sourcing" it int o a st at ic JavaScript file which you link in your blog t em plat e. You can t hen include a link reading " Show video," as pict ured in Figure 9- 9, which t riggers t he JavaScript funct ion t o writ e t he act ual em bed code t o t he browser. This is t he HTML port ion needed ( t he video I D is highlight ed again) :

    + Show video



    Of t h e t h r e e " Sh ow vide o" lin k s in t h is for u m t h r e a d a t Google Blogoscope d, t h e m iddle on e h a s be e n e x pa n de d. Ot h e r s ca n be e x pa n de d a t t h e sa m e t im e ; w h e n you colla pse a se ct ion a ga in , it w ill st op bu ffe r in g.

    The first param et er shown in t he snippet —" 1" in t his exam ple—is increm ent ed t hroughout your HTML file t o different iat e one HTML block from t he next while handling it . As you can see, t here is an " expander" and an " expandee," t he lat t er being j ust a placeholder t o carry your em bed code. And t he following is t he JavaScript funct ion t o act ually show t hat em bed code, along wit h t wo general funct ions t o dynam ically show and hide HTML elem ent s ( not e t hat " elem ent " is abbreviat ed as " elm " in t he code) . I nclude t he code by creat ing an ext ernal JavaScript file ( in t his exam ple, it 's nam ed player.j s) , linked from wit hin your HTML sect ion using . Alt ernat ively, you can also put it int o your blog t em plat e for every page, wrapped wit hin : Code View: function showVideo(n, videoId) { showElm("expandee" + n); hideElm("expander" + n); var elm = document.getElementById("expandee" + n); if (elm) { elm.innerHTML = "- Hide video
    " + "" + "" + "
    " + "youtube.com/watch?v=" + videoId + ""; }

    }

    function showElm(name) { var elm = document.getElementById(name); if (elm) { elm.style.display = "block"; } } function hideElm(name) { var elm = document.getElementById(name); if (elm) { elm.style.display = "none"; } }

    As you can see, t he showVideo funct ion hides t he " expander" elem ent but shows t he " expandee" elem ent . I t will t hen fill t he " expandee" elem ent wit h t he YouTube em bed code, and also add a link reading " Hide video" t o collapse t he video again. The height and widt h of t he player in t his exam ple are slight ly adj ust ed t o be a bit larger t han t he default size, but t here's anot her specialt y wit h t his em bed code: it carries t he " aut oplay= 1" flag, because you don't want your visit ors t o have t o click t he play but t on once m ore when t hey've already clicked your " Show video" link. What happens when t he user now presses t he " Hide video" link? The following JavaScript will be t riggered—and t his t im e, t he video buffer st ops loading, t oo, at least in t he popular browsers t hat t his has been t est ed wit h: function hideVideo(n, videoId) { var elm = document.getElementById("expandee" + n); if (elm) { elm.innerHTML = " "; } showElm("expander" + n); hideElm("expandee" + n); }

    H a ck 9 0 . Add Su bt it le s t o a Google Vide o Allow video viewers t o get t he m essage of your film even wit hout hearing any sound. This can be suit able bot h for hearing- im paired viewers as well as people who wat ch your videos in an office environm ent . Google Video provides t he opt ion t o add subt it les t o any video you've uploaded. To t ry t his, upload a video by going t o ht t p: / / video.google.com and following t he " Upload your videos" link. Google accept s t he form at s AVI , MOV, WMV, MPEG, and Real. Once you've uploaded your video and it has been approved and processed—t his m ay t ake som e t im e—you will not ice an add but t on next t o t he label Capt ions/ subt it les on your Uploaded Videos page. The plain t ext form at of t he capt ions you can ent er int o Google Video is t he t im e code where t he capt ion begins, followed by t he capt ion it self, followed by t he t im e when t he capt ion ends. Here is a sam ple bit , also shown in Figure 9- 10: 00:00:06.000 I am glad to welcome you to a new show of Animals Today. 00:00:08.900 00:00:15.000 Today we're going to discuss the secret life of dolphins. ...

    Pr ovidin g su bt it le s for Google Vide o

    Creat ing t he t im e codes and capt ions m anually would be t oo m uch work in m ost circum st ances. I deally, you'd

    be able t o see t he video and subt it le it by j ust t yping your t ext below it , in real t im e. There's a great and free t ool available t o achieve j ust t hat , t oo: Subt it le Horse at ht t p: / / subt it le- horse.org. When you visit Subt it le Horse, you are first required t o provide a video URL. Here is a sam ple URL t hat I will ent er ( t he video is a t our t hrough Blogger's visual t em plat e rearrangem ent feat ures) : http://video.google.com/videoplay?docid=-6552945338831467357&hl=en

    Click t he Subm it but t on and you will find a Flash- based t ool t o add subt it les t o t he video, as shown in Figure 911. When t he video plays, ent er capt ions in t he box below it , and press t he Ret urn key when you're done. Com plet e t he process for t he whole video. Finally, select t he Subt it le Horse m enu ent ry reading I m port / Export and choose t he " export subt it les" opt ion. Choose t he player form at " video.google" and copy t he result ing snippet t o your clipboard. Now go back t o t he Google Video subt it le subm ission page, past e your copied t ext , and hit t he Add but t on. Please not e t hat t he subt it les m ay t ake a while before t hey appear in your video. When t hey do, t he result will be sim ilar t o t he one shown in Figure 9- 12.

    Su bt it le H or se m a k e s cr e a t in g ca pt ion file s e a sy

    Su bt it le s on a vide o sh ow ca sin g Blogge r

    H a ck 9 1 . D ow n loa d a You Tu be or Google Vide o Film for Offlin e Con su m pt ion Creat e an offline video library by downloading cont ent from YouTube and Google Video. Google Video som et im es offers you a link t o download a video, but not always. And YouTube never displays t his funct ionalit y. What if you want t o have t he video on your local hard disk, so you can wat ch it wit hout having t o wait for t he file t o buffer, or view it when you're not online? There's a solut ion for t his: several sit es offer a service t o download YouTube and Google Video film s for offline viewing. The form at you will end up wit h is called FLV ( Flash Video) , so all you need t hen is a local FLV player. Fir st , loca t e t h e vide o a ddr e ss in qu e st ion . Go t o ht t p: / / yout ube.com or ht t p: / / video.google.com , and j um p t o a specific video, as shown in Figure 9- 13. At YouTube, t he URL will look som et hing like t he following—copy down t he address t o convert it lat er on: http://www.youtube.com/watch?v=4xQja0XMxfg

    Google Video, on t he ot her hand, searches t hrough different video sit es. To find j ust cont ent uploaded t o Google Video it self, use t he " sit e" operat or when searching, as in t he following exam ple: site:google.com cats

    Alt ernat ively, you can also select t he checkbox below t he search box reading " videos host ed by Google." The video address you end up wit h will be sim ilar t o t he following one ( I 've rem oved unim port ant param et ers from t he URL) : http://video.google.com/videoplay?docid=-2068277021797460895

    Se con d, dow n loa d t h e FLV file . Now t hat you have t he video address, different sit es are available t o convert t he video t o a download. KeepVid at ht t p: / / keepvid.com is one of t hem , and it has an easy- t o- use int erface, as shown in Figure 9- 14. ( Or t ry a Google search for " download yout ube" and you'll find a num ber of alt ernat ives.) Just past e t he video address int o t he input box and click t he Download but t on. The download link will now appear som ewhere below t he input box. Click t hat link and wait for t he download t o finish. Now renam e t he video file t o have an FLV ext ension; t hat is, change it from get _v ideo t o get _video.flv.

    N OTE You can also include a KeepVid download but t on in your browser. Just drag t he but t on at t he t op right of t he KeepVid hom e page ont o your links t oolbar. I t 's labeled " Drag t his but t on ont o your links t oolbar" in Figure 9- 14. Then, when you are on a YouTube or Google Video video page, click t he but t on reading " Keep I t ! " . This will forward you t o KeepVid, where you can t hen pick t he download link.

    I f you're using Firefox, t here's an alt ernat ive solut ion t o download t he FLV file, and it doesn't require a t hirdpart y sit e: you can inst all t he Firebug ext ension, which let s you see and individually download all t he files t he browser request s, including Flash videos. I nst all Firebug from ht t p: / / get firebug.com ; a browser rest art will be Firebug Open Firebug from t he m enu. I f a link appears offering you t o Enable necessary. Then, pick Tools Firebug, click it as well. Now visit t he YouTube page in quest ion and let it load for a bit .

    Th e You Tu be vide o, st ill on lin e - on ly

    Ke e pVid con ve r t s a ddr e sse s of You Tu be or Google Vide o film s in t o dow n loa da ble file s

    I n t he Firebug pane, you will not ice a list of files appearing. The FLV file in quest ion should be t he largest file in t he list nam ed get _v ideo, as point ed t o in Figure 9- 15. Right - click t his file list ing and choose Open in New Tab; your FLV download will now st art . ( You m ay want t o disable Firebug aft erwards, as it can slow down cert ain sit es.) As discussed previously, renam e t he downloaded file so t hat it will have an * .flv ext ension. Th ir d, ge t a n FLV pla ye r t o vie w t h e dow n loa de d vide o. You've got t he video file on your hard disk now but chances are t hat you don't have a viewer for it . You will need t o inst all an FLV player t o run t he file. To find an FLV player for your plat form , t ry a Google search for " Windows FLV player," " Mac FLV Player," and so on. For inst ance, a free FLV player for Windows XP and Vist a by a com pany nam ed Applian Technologies is available at t he address ht t p: / / applian.com / flvplayer/ download_flv_player.php. Anot her Windows player can be downloaded via ht t p: / / m art ij ndevisser.com / blog/ flv- player/ . A Mac OS X player called Wim py is available at

    ht t p: / / wim pyplayer.com / product s/ wim py_st andalone_flv_player.ht m l. I f you don't m ind going t hrough configuring HTML files t o em bed t he video in, t he HTML/ Flash- based player available at ht t p: / / j eroenwij ering.com / ?it em = JW_FLV_Player is an opt ion as well, and it works across different operat ing syst em s ( as long as you have Flash inst alled in your browser) .

    Fir e bu g r e ve a ls t h e Fla sh vide o file t h a t you w a n t t o dow n loa d

    Once inst alled, you can open your * .flv file wit h t he respect ive player, as shown in Figure 9- 16 using t he program by Applian Technologies.

    Th e Applia n Te ch n ologie s FLV pla ye r in a ct ion ( fr om a vide o by h e yit scor ie )

    Fin din g t h e r igh t vide os Any kind of video cont ent will work wit h t his download hack, but longer film s m ight be especially suit ed for an offline library. Alt hough YouTube rest rict s all video cont ent t o 10 m inut es, Google Video allows longer m ovies—like full docum ent aries.

    To find such longer film s, click on t he Advanced Video Search link on t he Google Video hom e page. I n t he Durat ion box, choose Long ( > 20 m in) . Under Genre, click t he it em nam ed " specific genres," if you want t o, and check Docum ent ary or Movie ( feat ure) and so on. Aft er hit t ing t he search but t on, depending on your search set t ings, t housands of videos will appear. As som e of t hese m ovie files will be quit e large now, an overnight download can m ake sense. Happy wat ching!

    N OTE I f you want t o edit downloaded FLV videos, you m ight first want t o convert t hem t o a m ore com m on form at . On Windows you can use t he free SUPER convert er found at t he bot t om of ht t p: / / www.eright soft .com / SUPER.ht m l t o t hen convert t o AVI for edit ing in t he ( again free) Microsoft Windows Movie m aker at ht t p: / / www.m icrosoft .com / windowsxp/ downloads/ updat es/ m oviem aker2.m spx.

    H a ck 9 2 . Ge ot a g You r Ph ot os a n d Sh a r e Th e m on Google M a ps Connect phot os t o locat ions, and drop t he whole bundle ont o Google Maps for easy sharing. Geot agging is t he t erm for adding locat ion inform at ion t o im ages ( am ong ot her m edia and dat a) . Maybe t hat beaut iful sunset was phot ographed in I biza, Spain, or t he porcelain ham st er snapshot is from an ant ique shop in Chicago. You know, and m aybe your friend knows, but t he com put er program s dealing wit h your pict ures m ay not know—t hough if you t each t hem , t hey can add a bunch of ot herwise unavailable ext ra services on t op of your phot o album s. I n Google's Picasa Web Album s ( ht t p: / / picasaweb.google.com ) , geot agging is easy and visual. Just locat e your album and wit hin it , your phot o. Now in t he bot t om right of t he page, as shown in Figure 9- 17, you will not ice a link reading " Add locat ion." Follow t his link and a m ap dialog pops up where you can set t he locat ion where t he phot o was t aken. For inst ance, I 've ent ered " ibiza, spain" int o t he search box ( no quot es) , as shown in Figure 918, checked t he m ap for accuracy, and confirm ed wit h t he Save locat ion but t on. Your phot o will now display a sm all m ap next t o it whenever you view it . Repeat t his process of geot agging for all of your phot os where it m akes sense. Not e t hat you will be able t o drag and drop t he locat ion m arker in consecut ive dialogs, as your previous locat ion will be saved for fut ure phot os. Now t hat your im ages are prepared, you can click t he " View album m ap" link. I f your phot os are part of a single holiday t rip, t hen t hey will now be shown along your original rout e, as depict ed in Figure 9- 19. Clicking on an individual m arker opens a sm all info box on t op of t he locat ion cont aining a larger version of t he im age, as well as your im age capt ion, if provided.

    You r ph ot o in Pica sa W e b Albu m s ( Ph ot o sou r ce : U.S. N a t ion a l Oce a n ic a n d At m osph e r ic Adm in ist r a t ion .)

    Th e ge ot a ggin g dia log

    Th e t r a ve l m a p

    Addin g You r Ph ot os t o Google M a ps As you can see in Figure 9- 19, t he phot os are already displayed in a Google Maps widget . But you are also able t o export t he geographical m et adat a t o drop it int o t he ext ernal Google Maps sit e—and from t here, int o your own sit e.

    For t his st ep, you need t o grab a file of t he KML form at . KML m eans Keyhole Markup Language; Keyhole was t he com pany t hat originally developed t he program t hat was lat er t urned int o Google Eart h, t he 3D- view deskt op applicat ion sibling of Google Maps. You will find t he address of t he file on your album page as well as your album m ap page, wit h t he View in Google Eart h link. Right - click t he link, t hen use t he m enu t hat appears t o copy it s URL. The address will look sim ilar t o t he following: http://picasaweb.google.com/data/feed/base/user/officehacks/ albumid/5125663951730983025?kind=photo&alt=kml&hl=en_US

    However, inst ead of adding t his t o Google Eart h, you can also j ust add it t o Google Maps. Go t o ht t p: / / m aps.google.com and past e t he KML file URL int o t he search box and hit Search Maps. Google will recognize t hat you've ent ered t he web address of a KML file and aut om at ically display your phot os on t he m ap now. Click " Link t o t his page" and a new dialog opens. Here you can eit her select t he URL t o point ot hers t o, or copy an HTML snippet for inclusion on your web sit e, such as your blog.

    N OTE Google Maps also support s KMZ files for display as a layer. KMZ is a zipped KML file. To find KMZ or KML files t hat ot hers have published, you can search Google for "filetype:kmz | filetype:kml" ( no quot es, and t he | charact er is t he vert ical line or " pipe" charact er) , and copy t he URL shown below t he snippet int o Google Maps as before ( not e t he URL m ust be preceded wit h " ht t p: / / " when you past e it int o Google Maps) .

    H a ck 9 3 . Re size a n d Cu st om ize Em be dde d Vide os Don't let YouTube lim it you t o t heir default video size and colors when sharing cont ent . To em bed a video from YouTube, all you need t o do is go t o ht t p: / / yout ube.com , search for cont ent , and t hen copy t he em bed code int o your own sit e. Here's an exam ple of t he em bed code, which you can find at t he right side of t he video player, as shown in Figure 9- 20. I f you use a rich t ext edit or for your sit e, m ake sure t o swit ch t o t he HTML edit ing m ode before past ing t his in: Code View:

    WANT EVEN MORE CUSTOMI ZI NG OPTI ONS? Wit h som e program m ing, you can connect t o t he YouTube JavaScript Player API and em bed a cust om , so- called chrom eless player. Check out ht t p: / / blogoscoped.com / yout ube- api/ t o get you st art ed.

    Re sizin g a Vide o What if you want t o include a different size t han t he default one YouTube offers you? Just replace all occurrences of t he widt h and height pixel values—here, 425 and 355, respect ively, as highlight ed earlier—wit h values of your own choosing. To m ake sure t hat t he video is resized proport ionally, you can use any im age edit ing soft ware; j ust creat e a new im age file of t he base size 425 x 355, and t hen resize t he im age t o a specific widt h—say, 500. Your im age edit or will now ( usually) be able t o adj ust t he widt h accordingly, keeping proport ions int act . I n t he case of a widt h of 500, t he height would now be 418, as shown in Figure 9- 21.

    Copyin g t h e e m be d code for a You Tu be vide o ( n ot e t h a t for som e vide os, e m be ddin g h a s be e n disa ble d by t h e ow n e r )

    Re sizin g a n im a ge in Pa in t Sh op Pr o 4 , on e of t h e m a n y a va ila ble pict u r e e dit or s

    Ch a n gin g color s a n d a ddin g bor de r s on a You Tu be vide o

    A n e w color sch e m e for You Tu be 's pla ye r

    Addin g Color s Next t o t he em bed code at YouTube is a " cust om ize" link t o add different colors t o t he YouTube player. You can also choose t o have a border on t he player. Here's an exam ple snippet t o m ake an orange int erface, including a border, as shown in Figure 9- 22 ( relevant param et ers are in bold) : Code View: < /object>

    However, you can go beyond t he color choices t hat YouTube present s t o you in t heir cust om izat ion dialog. The param et ers color1 and color2 are sim ply t wo part s of a gradient . The values, like " 0xe1600f," are hexadecim al num bers from 0- 255 represent ing red, green and blue. I n t his case, 0x j ust st art s t he hexadecim al num ber, followed by E1, 60, and 0F, m eaning 225, 96, and 15 ( which is a t one of orange in t he addit ive color m odel used by web pages) . To m ix your own colors, check t o see whet her your phot o edit or of choice support s hexadecim al not at ion. I f not , an online applicat ion like ht t p: / / m ediagods.com / t ools/ rgb2hex.ht m l com es in handy. Wit h your new hexadecim al values in hand, you can replace bot h gradient color pairs found in t he YouTube snippet . I picked cyan and black for t he exam ple shown in Figure 9- 23, playing t he video " Meet m y pet s! " by heyit scorie ( ht t p: / / yout ube.com / wat ch?v= 4xQj a0XMxfg) .

    H a ck 9 4 . D isgu ise You r Pica sa I de n t it y Change your Picasa address, and add anot her login nam e t o your Google account at t he sam e t im e. When your Google usernam e is your real nam e—such as JaneAnnDoe1980@gm ail.com —t hen your Picasa Web Album addresses will be along t his form at , including t hat nam e: http://picasaweb.google.com/JaneAnnDoe1980/MiscellaneousPics

    However, t here m ay be t im es when you want t o share pict ures of your album wit hout revealing your full nam e ( or your birt h year, for t hat m at t er) . Picasa already allows you t o select a nicknam e different from your Google nam e for display on album pages. But t he URL, as shown in t he exam ple, is st ill a giveaway. But t here's help, as Rom anian Google wat cher I onut Alex. Chit u discovered on his independent blog Google Operat ing Syst em ( ht t p: / / googlesyst em .blogspot .com ) . First , login t o Picasa Web Album s at ht t p: / / picasaweb.google.com . Click Set t ings on t op. I n t he sect ion t it led Gallery URL, t here's a link t o t he right hand side reading " Want t o add a new Google user nam e?" as pict ured in Figure 9- 24.

    Th e Pica sa W e b Albu m s se t t in gs pa ge a llow s you t o ch a n ge you r URL

    Aft er clicking on t his link, you will be forwarded t o a dialog where you can provide an alt ernat e user nam e for t his account , like " rogerrabbit " , or any ot her nam e t hat 's st ill available. Confirm t he change via t he Add Usernam e but t on. I n t he m ain set t ings dialog, select your newly chosen nam e, and OK t he select ion by clicking t he Save Set t ings but t on at t he bot t om of t he page. You will find t hat your gallery can now also be reached via an address such as: http://picasaweb.google.com/rogerrabbit/MiscellaneousPics

    I nt erest ingly enough, now you can also log in t o your Google account anywhere by ent ering your chosen new nam e ( in t he exam ple case, " rogerrabbit " ) . I f you feel t hat your originally chosen user nam e is t oo long t o repeat edly t ype during t he login process t o Google, why not change it t o som et hing short er, if available? Just not e t hat you can only add up t o four new nam es t his way.

    H a ck 9 5 . D ispla y M u sic Vide o Lyr ics Sing along wit h m usic videos! YouTube host s a lot of m usic videos, as a search for your favorit e singer or band will probably reveal. Som e of t hem include subt it les wit hin t he video, but what if you want t o sing along a video t hat doesn't include lyrics? A Greasem onkey script for Firefox com es t o t he rescue ( wit h a t ip of t he hat t o t he Google Operat ing Syst em blog at ht t p: / / googlesyst em .blogspot .com ) . First , inst all Greasem onkey from ht t ps: / / addons.m ozilla.org/ en- US/ firefox/ addon/ 748 [ Hack # 42] . Make sure t hat t he m onkey in t he bot t om right of Firefox is sm iling, which m eans t hat Greasem onkey is act ivat ed ( click t he icon if t hat 's not t he case) . Now j um p t o ht t p: / / userscript s.org/ script s/ show/ 22569, click t he " I nst all t his script " but t on, and follow t he inst allat ion process; not e t hat because user script s can execut e t heir own com m ands, you should inst all only script s you t rust . Next , locat e a video clip at YouTube.com . There won't be lyrics available for all videos, but for som e; t o get t his t o work, it seem s t o be crucial t hat t he art ist 's nam e as well as t he song nam e are included in t he t it le of t he video. For inst ance, t he URL ht t p: / / www.yout ube.com / wat ch?v= t At cJ954Tj Q—t it led " Badly drawn boy - Once around t he block" —will do. Now check t he right hand sidebar on t he video page. I f all went well, an arrow and t he word Lyrics will appear. Click t his label t o expand t he lyrics, which will t ake a m om ent t o load. A successful result , as shown in Figure 925, allows you t o do a lit t le karaoke ( t o t he pot ent ial det rim ent of your neighbors—but hey, life is short ! ) .

    Sh ow in g t h e lyr ics of t h e son g n e x t t o t h e vide o

    I f t he lyrics t o your favorit e video cannot be found, or t he wrong ones are displayed, you have t he opt ion of choosing anot her lyrics provider from t he checkbox nearby. As a fallback, you can also do a Google search for t he art ist and song nam e, appending t he word " lyrics" , as in " loudon wainwright t he swim m ing song lyrics" ( wit hout t he quot es) .

    N OTE By default , t he lyrics label won't show when you om it t he " www" from t he YouTube URL. To enable t his Greasem onkey Manage User userscript t o work bot h wit h " www" and wit hout , choose Tools Script s from t he Firefox m enu. Select YouTube Lyrics in t he left hand list , and add "ht t p: / / yout ube.com / wat ch?* " t o t he I ncluded Pages list , as shown in Figure 9- 26.

    Allow in g t h e u se r scr ipt t o w or k w it h m or e URLs

    H a ck 9 6 . Be yon d Google : Fr om Flick r t o Vim e o a n d Blip.t v Life is a sum of all your choices, as Albert Cam us said. And if Google doesn't cut it for you, here's a lit t le help in choosing t he right phot o and video sharing sit es. There are a lot of m edia- sharing sit es beyond Google's propert ies. This hack includes a list t o get you st art ed. Not e t hat alt hough som e of t he lesser- known sit es for m edia sharing m ay have feat ures you prefer individually, viewers of your m edia m ay have an easier t im e underst anding int erfaces and feat ures of sit es t hat t hey're already used t o. That shouldn't st op you from swit ching from YouTube t o t he less well- known Vim eo, for exam ple, but it 's wort h keeping in m ind. Flick r Flickr, owned by Yahoo! , is a phot o sharing sit e not unlike Picasa Web Album s. I t 's been around for longer, t hough, and has som e int erest ing feat ures not available in Google's com pet ing product . Am ong t he m ost int erest ing differences:

    You can t ag your phot os wit h a Creat ive Com m ons license [ Hack # 31] . People on t he sit e can t hen search specifically for j ust t he phot os wit h t his " sharing enabled" license at t ached t o it , pot ent ially giving your pict ures m ore exposure.

    Groups in Flickr bring t oget her like- m inded people for phot o sharing on specific subj ect s. ( For inst ance, a group pool called Clock Works was set up t o com pile one phot o of a clock face for every m inut e of t he day, in chronological order; when run in slideshow m ode, t his result s in an int erest ing film ! )

    I f your Flickr phot os appear in Yahoo! search result s, t hey will display your usernam e right below t hem .

    Flickr has it s own m essaging syst em on t he sit e, alert ing you of new happenings, such as when anot her Flickr user adds you as a cont act .

    A calendar displays t he m ost int erest ing phot os of each day for easy explorat ion. You can also view phot os displayed on a world m ap.

    The Cam era Finder let s you browse phot os by specific cam era m aker and m odel.

    You can bat ch- organize your phot o collect ion via drag and drop.

    A phot o edit or called Picnik let s you ret ouch your pict ures wit hout leaving t he browser. You can resize, crop, adj ust colors, sharpen your im age, rem ove t he red eye effect , overlay t ext or clip art , and m ore.

    To sign up for Flickr, visit ht t p: / / flickr.com . You can use your Yahoo! login, if you have one. Once you're logged in, you can st art t o m anage your phot os, as shown in Figure 9- 27. Once you upload phot os, an individual phot o page appears, sim ilar t o t he one shown in Figure 9- 28. Flickr is free t o use in it s basic variant , and offers you a pro account for $24.95 per year, including unlim it ed st orage, phot o st at ist ics, and ad- free browsing, am ong ot her feat ures. Phot o edit or Picnik ( ht t p: / / www.picnik.com ) is also available in a prem ium variant , for $24.95 per year.

    Ot her phot o- sharing sit es include Zooom r ( ht t p: / / zooom r.com ) , Sm ugMug ( ht t p: / / sm ugm ug.com ) , Phot obucket (ht t p: / / phot obucket .com ) and Fot ki ( ht t p: / / fot ki.com ) .

    You r Flick r da sh boa r d

    An in dividu a l ph ot o pa ge ( or in t h is ca se , a dr a w in g I m a de ) ; a s ow n e r of t h e ph ot o, you 'll se e a cou ple of bu t t on s on t op ot h e r visit or s w on 't se e , in clu din g Edit Ph ot o or D e le t e .

    Vim e o

    For video- sharing, t ake a look at Vim eo.com . Signup is quick, and requires you t o confirm a regist rat ion m ail sent out t o you. Then you can share your first video by clicking Upload on t op. While t he video is uploading, you can edit t he film 's t it le, descript ion, and t ags, as shown in Figure 9- 29.

    Uploa din g a vide o a t Vim e o

    Alt ernat ively, you can also upload videos via em ail—especially suit ed for film s recorded wit h your m obile phone. Look for your special em ail address t o send clips t o; it 's on t he bot t om right of t he upload page. Your video playback page will have a URL like ht t p: / / vim eo.com / 739349, and appear sim ilar t o t he one in Figure 9- 30. The video page looks neat and unclut t ered. On t he downside, t he video will not aut om at ically buffer or play when you visit t he video page—you also won't see any buffering or playback t im e st at us unless you hover over t he video. As wit h YouTube, videos can be em bedded elsewhere using an HTML snippet .

    N OTE The Vim eo HTML source code cont ains a kind of East er egg in t he form of ASCI I art . Have a look by right - clicking any page, and select ing View Page Source ( or sim ilar) from t he cont ext m enu!

    An in dividu a l Vim e o vide o pla yba ck pa ge

    Blip.t v Blip.t v ( yep, t hat 's t he URL; ht t p: / / blip.t v ) also let s you upload your video. During upload, you can provide inform at ion on your video and also choose from am ong several variant s of t he Creat ive Com m ons license. Your video URL will be in t he form at of ht t p: / / blip.t v/ file/ 705790, displaying as shown in Figure 9- 31. Not e t hat unt il Blip.t v finishes convert ing your video, t he video player m ay require t he inst allat ion of an addit ional Windows Media Player plugin, which is som et im es t roublesom e in Firefox—once t he video processing is done, video playback works fine in Firefox, t hough, as shown in Figure 9- 31. Som e m ore video sharing sit es t hat you m ay want t o t ry include:

    Jum pcut (ht t p: / / j um pcut .com )

    Veoh ( ht t p: / / veoh.com )

    Yahoo! Video ( ht t p: / / video.yahoo.com )

    Viddler ( ht t p: / / viddler.com )

    Eyespot (ht t p: / / eyespot .com )

    Th e Blip.t v vide o pla ye r

    Som e video sit es I t ried, like Revver (ht t p: / / revver.com ) or Spike ( ht t p: / / spike.com , form erly known as iFilm ) m ade it com plicat ed t o do quick uploads; during t he t im e of t his writ ing, t he uploaded videos were st ill in a long processing or reviewing phase and did not appear live. Not e t hat som e blogging t ools include video sharing opt ions as well [ Hack # 114 ] .

    QUI CK HACK GI VEN A SPECI FI C WEB SI TE OR PRODUCT, LI KE YOUTUBE, HERE'S HOW TO FI ND SI MI LAR OFFERI NGS One way t o find t hings t hat are like YouTube is t o search Google.com for " yout ube" . Below t he first result ( probably YouTube.com ) , click " Sim ilar pages." You'll see ( m ost ly) relat ed sit es. Anot her way t o find relat ed sit es, services, or product s is t o check Wikipedia (ht t p: / / w ikipedia.org) ; som et im es, Wikipedia cont ains an ent ry about a web sit e, list ing relat ed web sit es at t he end of t he art icle, or point ing t o a full com parison chart ent ry on Wikipedia. Yet anot her opt ion is t o visit Google Set s at ht t p: / / labs.google.com / set s. Ent er " yout ube" in t he first field, and also som e ot her sit e m ent ioned in t his sect ion, like " vim eo," in t he second field. Press Ret urn, and your list will be expanded t o show m any m ore relat ed sit es [ Hack # 26] . Also, som et im es you can search Google for a phrase like " * is bet t er t han yout ube" —including t he quot es—or " i prefer * t o yout ube" or " * is like yout ube" ( replace " yout ube" wit h any ot her sit e you want t o research, as needed) . I n t he result s, you'll find com pet it ors list ed in bold! Once you know a set of product s or sit es wit hin t he niche you are researching, you can also com bine t hem int o one search query. Go t o Google and ent er ( for exam ple) " yout ube spike vim eo" , and so on ( wit hout t he quot es) . Som et im es t his t ype of search leads t o art icles reviewing t hese services t hat com pare pros and cons. This can work wit h ot her t hings t oo, so you can also ent er ( for exam ple) " canon nikon sony kodak olym pus" t o find cam era com parisons. I f you get t oo m any unrelat ed result s, add words like " review" or " com parison" t o t he query.

    CREATE YOUR OW N H OM E PAGE, BLOG, OR GROUP Google offe r s se ve r a l fr e e t ools t o cr e a t e you r ow n w e b pr e se n ce for t h e pu r pose of pu blish in g you r a r t icle s or discu ssin g t opics w it h a gr ou p. You ca n a lso com bin e se ve r a l of t h e se t ools, su ch a s con n e ct in g a blog t o you r discu ssion gr ou p, t o cr e a t e a u se fu l on lin e de st in a t ion . I t 's a r e a d- w r it e w e b, so h e r e 's h ow t o w r it e t o it , u sin g Google 's t ools. Pu blish Re gu la r N e w s or Pe r spe ct ive w it h a Blog I f you have a Google Account [ Hack # 1] , you can sign up wit h Blogger.com and creat e your own blog ( see [ Hack # 11] and [ Hack # 109 ] ) . This will give you space t o post it em s, recent ones displayed first , wit h readers able t o leave com m ent s on each art icle. On your blog you can publish j ust about anyt hing: your personal life, diary- st yle; news, wit h a focus on one t opic, or m ore general coverage of world issues wit h your own unique perspect ive; serialized fict ion; hom em ade cart oons, and m ore. You can also use a blog t o " clip" your favorit e part s of t he web, like showcasing a daily favorit e YouTube video of yours by em bedding it int o t he post . Your blog's address will be eit her ht t p: / / som et hing.blogspot .com , where " som et hing" is your chosen blog nam e ( if it hasn't been t aken! ) —or you can configure Blogger t o t ransfer your blog post s t o your own server via FTP ( File Transfer Prot ocol) .

    Th e Blogge r da sh boa r d a ft e r r e gist e r in g a n d sign in g in

    Cr e a t e You r H om e Pa ge w it h Google Pa ge Cr e a t or Hom e pages are a lit t le m ore st at ic and less com m unicat ive t han blogs, but t hey can st ill serve a purpose. For inst ance, m aybe you want t o offer a cert ain download of your finished ebook. Or you want t o add a list of Frequent ly Asked Quest ions on t he subj ect of flesh- eat ing plant s—a list t hat m ight see several am endm ent s in t he fut ure, but t hat won't be m oved furt her down t he page by new art icles. Once you have a Google Account set up, you can head st raight over t o ht t p: / / pages.google.com t o give t his a t ry. The edit or is pict ured in Figure 10- 2 and t he result s in Figure 10- 3. You can see t hat t he edit or is m ost ly WYSI WYG ( What - You- See- I s- What - You- Get ) . Elem ent s can be clicked t o edit t heir cont aining t ext . You can adj ust font st yles, include im ages, change t em plat es, add Google gadget s, and m ore.

    Google Pa ge Cr e a t or in e dit in g m ode

    Th e pu blish e d pa ge

    Se t Up You r Ow n D iscu ssion Gr ou p w it h Google Gr ou ps Even m ore com m unicat ive t han a blog is a discussion group. Google Groups is t he Google app t hat handles Usenet ( an int ernat ional, dist ribut ed bullet in board syst em ) discussion newsgroups. But Google adds t heir own, non- Usenet groups t o t he m ix, and you t oo can creat e one of t hese. Just click t he " Creat e a group" but t on shown on t he Google Groups hom e page aft er you've logged in, as shown in Figure 10- 4. Groups can be bot h public or privat e and invit e- only, as t he set - up dialog displayed in Figure 10- 5 illust rat es. Once you've creat ed a group, you can edit cert ain pages in it —like t he welcom e screen—wit h t he Google Page Creat or int erface. The result m ay look sim ilar t o t he sam ple group pict ured in Figure 10- 6.

    Th e Google Gr ou ps st a r t pa ge

    Se t t in g u p a gr ou p

    Th e gr ou p's st a r t pa ge

    I nvit ing a new m em ber m eans t hat an invit at ion will be sent t o t heir em ail account . However, if t hey are using Gm ail, chances are t hat t his invit at ion will land in t heir spam folder, where it 's likely t o be ignored. You can get around t his problem by clicking " I nvit e m em bers" and going t o t he " Add m em bers direct ly" t ab. Not e t hat , as Google warns on t hat page, you are supposed t o add only people you know and using t he feat ure t o send unwant ed m ails can lead t o account deact ivat ion.

    H a ck 9 7 . Add a Ga dge t t o You r Google Pa ge ( or Blog) Gadget s are t he spice of hom e page cooking: add t oo few, and your page m ay t ast e bland . . . but add t oo m any, and you'll t urn people's st om achs. Cook wisely! Google gadget s—from search t ools t o weat her inform at ion t o clocks and gam es—are perhaps best known for being used on t he iGoogle hom e page ( see Chapt er 6 ) . But m any gadget s are also able t o live out side t hat space and m igrat e t o t he Google Deskt op program , as well as m ost web pages or blogs, including Google's Blogger, and sit es creat ed wit h Google Page Creat or. Addin g a Ga dge t in Google Pa ge Cr e a t or To see how you can add a gadget t o a Google Page Creat or page, st art by logging in t o ht t p: / / pages.google.com . Click t he link reading " Creat e a new page" and nam e it anyt hing you want . I 'll pick " Global Warm ing I nfo Page" for m ine, and hit t he " Creat e and Edit " but t on. You'll now be ent ering t he edit m ode of Google Page Creat or. You can swit ch t o a t wo- colum n layout first t o m ake som e room for t he gadget . Click Change Layout on t op and select one of t he st yles offered, for a result like t he one pict ured in Figure 10- 7.

    Pr e pa r in g t h e pa ge t o m a k e pla ce for a ga dge t

    Now click t he link " add gadget " in t he bot t om right t o open t he gadget direct ory. Pick t he gadget you like by browsing t he direct ory or perform ing a search. There's so m any different gadget s t hat you can t ry j ust searching for your t opic at hand—for inst ance, I 've searched for " global warm ing" t o find a gadget called " Global Warm ing Daily Tip." Select t he gadget and configure it if needed, and confirm wit h OK. You can now click t he Preview link on t op t o check whet her t he design appears as you want it t o. Make design changes where needed—you m ay need t o select an elem ent and swit ch t o t he HTML edit ing m ode at t im es, for exam ple, t o adj ust t he " widt h" and " height " at t ribut es of an inline fram e elem ent —and you're ready t o go live wit h t he page by hit t ing t he Publish but t on. Your page is now public, as t he one shown in Figure 10- 8, at a URL like t his one: http://officehacks.googlepages.com/globalwarminginfopage2

    Th e pu blish e d pa ge ; t o t h e le ft side is you r ow n con t e n t , a n d t o t h e r igh t side r e st s a dyn a m ic ga dge t

    Add Ga dge t s t o You r Blog I f you don't have a blog yet , creat e one on your t opic of choice [ Hack # 11] . Suppose you want t o add a gadget t o your Blogger blog's sidebar. However, t he norm al Blogger.com edit or won't suffice at t his t im e; inst ead, point your browser t o ht t p: / / draft .blogger.com for a newer, m ore experim ent al version of Google's blog edit or. On your dashboard page, click on t he Layout link next t o your blog.

    You're now at t he Add and Arrange Page Elem ent s dialog as pict ured in Figure 10- 9. Click Add a Page Elem ent and in t he box t it led Gadget , click t he Add t o Blog but t on. Now it 's again t im e t o locat e your favorit e gadget ; for m y sam ple, I will choose one t it led " Environm ent : Random Graphic of t he Day," as shown in Figure 10- 10 . Aft er clicking Save Changes in t he gadget s dialog, and t hen clicking Save in t he underlying page t em plat e edit or, you can fine- t une part s of t he layout via t he Edit HTML link on t op. For inst ance, you can search for " sidebar- wrap" in t he HTML source's st ylesheet part and t hen edit t he widt h value t o increase t his elem ent 's size, allowing for wider gadget s. Here's t he " before" code: ... #sidebar-wrap { width:240px; ... and the "after" code: ... #sidebar-wrap { width:340px; ...

    To accom m odat e t his larger sidebar, you should also increase t he widt h defined in t he #outer-wrapper st yle. Your blog, like t he one pict ured in Figure 10- 11 , should show t hat all pages carry t he widget you included.

    N OTE Any cont ent wit hin gadget s, t ext or ot herwise, will not be indexed by search engines when t hey crawl your page. The reason is t hat gadget cont ent is delivered via an I Fram e ( an inline fram e on t he page) t hat point s t o cont ent from anot her server.

    Addin g a ga dge t t o t h e m a in t e m pla t e w ill a ffe ct a ll of you r blog

    Blogge r 's " Add a ga dge t " dia log

    Th e pu blish e d blog is n ow a ccom pa n ie d by a side ba r sh ow in g a da ily gr a ph ic

    CREATE YOUR OW N H OM E PAGE, BLOG, OR GROUP Google offe r s se ve r a l fr e e t ools t o cr e a t e you r ow n w e b pr e se n ce for t h e pu r pose of pu blish in g you r a r t icle s or discu ssin g t opics w it h a gr ou p. You ca n a lso com bin e se ve r a l of t h e se t ools, su ch a s con n e ct in g a blog t o you r discu ssion gr ou p, t o cr e a t e a u se fu l on lin e de st in a t ion . I t 's a r e a d- w r it e w e b, so h e r e 's h ow t o w r it e t o it , u sin g Google 's t ools. Pu blish Re gu la r N e w s or Pe r spe ct ive w it h a Blog I f you have a Google Account [ Hack # 1] , you can sign up wit h Blogger.com and creat e your own blog ( see [ Hack # 11] and [ Hack # 109 ] ) . This will give you space t o post it em s, recent ones displayed first , wit h readers able t o leave com m ent s on each art icle. On your blog you can publish j ust about anyt hing: your personal life, diary- st yle; news, wit h a focus on one t opic, or m ore general coverage of world issues wit h your own unique perspect ive; serialized fict ion; hom em ade cart oons, and m ore. You can also use a blog t o " clip" your favorit e part s of t he web, like showcasing a daily favorit e YouTube video of yours by em bedding it int o t he post . Your blog's address will be eit her ht t p: / / som et hing.blogspot .com , where " som et hing" is your chosen blog nam e ( if it hasn't been t aken! ) —or you can configure Blogger t o t ransfer your blog post s t o your own server via FTP ( File Transfer Prot ocol) .

    Th e Blogge r da sh boa r d a ft e r r e gist e r in g a n d sign in g in

    Cr e a t e You r H om e Pa ge w it h Google Pa ge Cr e a t or Hom e pages are a lit t le m ore st at ic and less com m unicat ive t han blogs, but t hey can st ill serve a purpose. For inst ance, m aybe you want t o offer a cert ain download of your finished ebook. Or you want t o add a list of Frequent ly Asked Quest ions on t he subj ect of flesh- eat ing plant s—a list t hat m ight see several am endm ent s in t he fut ure, but t hat won't be m oved furt her down t he page by new art icles. Once you have a Google Account set up, you can head st raight over t o ht t p: / / pages.google.com t o give t his a t ry. The edit or is pict ured in Figure 10- 2 and t he result s in Figure 10- 3. You can see t hat t he edit or is m ost ly WYSI WYG ( What - You- See- I s- What - You- Get ) . Elem ent s can be clicked t o edit t heir cont aining t ext . You can adj ust font st yles, include im ages, change t em plat es, add Google gadget s, and m ore.

    Google Pa ge Cr e a t or in e dit in g m ode

    Th e pu blish e d pa ge

    Se t Up You r Ow n D iscu ssion Gr ou p w it h Google Gr ou ps Even m ore com m unicat ive t han a blog is a discussion group. Google Groups is t he Google app t hat handles Usenet ( an int ernat ional, dist ribut ed bullet in board syst em ) discussion newsgroups. But Google adds t heir own, non- Usenet groups t o t he m ix, and you t oo can creat e one of t hese. Just click t he " Creat e a group" but t on shown on t he Google Groups hom e page aft er you've logged in, as shown in Figure 10- 4. Groups can be bot h public or privat e and invit e- only, as t he set - up dialog displayed in Figure 10- 5 illust rat es. Once you've creat ed a group, you can edit cert ain pages in it —like t he welcom e screen—wit h t he Google Page Creat or int erface. The result m ay look sim ilar t o t he sam ple group pict ured in Figure 10- 6.

    Th e Google Gr ou ps st a r t pa ge

    Se t t in g u p a gr ou p

    Th e gr ou p's st a r t pa ge

    I nvit ing a new m em ber m eans t hat an invit at ion will be sent t o t heir em ail account . However, if t hey are using Gm ail, chances are t hat t his invit at ion will land in t heir spam folder, where it 's likely t o be ignored. You can get around t his problem by clicking " I nvit e m em bers" and going t o t he " Add m em bers direct ly" t ab. Not e t hat , as Google warns on t hat page, you are supposed t o add only people you know and using t he feat ure t o send unwant ed m ails can lead t o account deact ivat ion.

    H a ck 9 7 . Add a Ga dge t t o You r Google Pa ge ( or Blog) Gadget s are t he spice of hom e page cooking: add t oo few, and your page m ay t ast e bland . . . but add t oo m any, and you'll t urn people's st om achs. Cook wisely! Google gadget s—from search t ools t o weat her inform at ion t o clocks and gam es—are perhaps best known for being used on t he iGoogle hom e page ( see Chapt er 6 ) . But m any gadget s are also able t o live out side t hat space and m igrat e t o t he Google Deskt op program , as well as m ost web pages or blogs, including Google's Blogger, and sit es creat ed wit h Google Page Creat or. Addin g a Ga dge t in Google Pa ge Cr e a t or To see how you can add a gadget t o a Google Page Creat or page, st art by logging in t o ht t p: / / pages.google.com . Click t he link reading " Creat e a new page" and nam e it anyt hing you want . I 'll pick " Global Warm ing I nfo Page" for m ine, and hit t he " Creat e and Edit " but t on. You'll now be ent ering t he edit m ode of Google Page Creat or. You can swit ch t o a t wo- colum n layout first t o m ake som e room for t he gadget . Click Change Layout on t op and select one of t he st yles offered, for a result like t he one pict ured in Figure 10- 7.

    Pr e pa r in g t h e pa ge t o m a k e pla ce for a ga dge t

    Now click t he link " add gadget " in t he bot t om right t o open t he gadget direct ory. Pick t he gadget you like by browsing t he direct ory or perform ing a search. There's so m any different gadget s t hat you can t ry j ust searching for your t opic at hand—for inst ance, I 've searched for " global warm ing" t o find a gadget called " Global Warm ing Daily Tip." Select t he gadget and configure it if needed, and confirm wit h OK. You can now click t he Preview link on t op t o check whet her t he design appears as you want it t o. Make design changes where needed—you m ay need t o select an elem ent and swit ch t o t he HTML edit ing m ode at t im es, for exam ple, t o adj ust t he " widt h" and " height " at t ribut es of an inline fram e elem ent —and you're ready t o go live wit h t he page by hit t ing t he Publish but t on. Your page is now public, as t he one shown in Figure 10- 8, at a URL like t his one: http://officehacks.googlepages.com/globalwarminginfopage2

    Th e pu blish e d pa ge ; t o t h e le ft side is you r ow n con t e n t , a n d t o t h e r igh t side r e st s a dyn a m ic ga dge t

    Add Ga dge t s t o You r Blog I f you don't have a blog yet , creat e one on your t opic of choice [ Hack # 11] . Suppose you want t o add a gadget t o your Blogger blog's sidebar. However, t he norm al Blogger.com edit or won't suffice at t his t im e; inst ead, point your browser t o ht t p: / / draft .blogger.com for a newer, m ore experim ent al version of Google's blog edit or. On your dashboard page, click on t he Layout link next t o your blog.

    You're now at t he Add and Arrange Page Elem ent s dialog as pict ured in Figure 10- 9. Click Add a Page Elem ent and in t he box t it led Gadget , click t he Add t o Blog but t on. Now it 's again t im e t o locat e your favorit e gadget ; for m y sam ple, I will choose one t it led " Environm ent : Random Graphic of t he Day," as shown in Figure 10- 10 . Aft er clicking Save Changes in t he gadget s dialog, and t hen clicking Save in t he underlying page t em plat e edit or, you can fine- t une part s of t he layout via t he Edit HTML link on t op. For inst ance, you can search for " sidebar- wrap" in t he HTML source's st ylesheet part and t hen edit t he widt h value t o increase t his elem ent 's size, allowing for wider gadget s. Here's t he " before" code: ... #sidebar-wrap { width:240px; ... and the "after" code: ... #sidebar-wrap { width:340px; ...

    To accom m odat e t his larger sidebar, you should also increase t he widt h defined in t he #outer-wrapper st yle. Your blog, like t he one pict ured in Figure 10- 11 , should show t hat all pages carry t he widget you included.

    N OTE Any cont ent wit hin gadget s, t ext or ot herwise, will not be indexed by search engines when t hey crawl your page. The reason is t hat gadget cont ent is delivered via an I Fram e ( an inline fram e on t he page) t hat point s t o cont ent from anot her server.

    Addin g a ga dge t t o t h e m a in t e m pla t e w ill a ffe ct a ll of you r blog

    Blogge r 's " Add a ga dge t " dia log

    Th e pu blish e d blog is n ow a ccom pa n ie d by a side ba r sh ow in g a da ily gr a ph ic

    H a ck 9 8 . Ba t t le Spa m in You r Blog Adj ust t he signal- t o- noise rat io in your favor. Spam —unwant ed and noisy bulk m essages t o prom ot e a product , sit e, or idea—is crawling around every corner of t he Web. And it 's not j ust in em ail, but also in blog com m ent s, blog post ings, search result s, t ag- based phot o sit es, wikis, and basically everywhere t hat people ( or bot s) can writ e som et hing som ehow. And if you run a blog, t hen ident ifying and suppressing com m ent spam m ay becom e one of your daily challenges. Just clicking t he Trash icon next t o spam m essages—you need t o be logged in t o see t he icon—is not always enough, so here are a few t ips on how t o cope. D isa ble Com m e n t s First of all, you don't necessarily need t o enable com m ent s for your blog. However, t his should be a last resort only; a com m ent - free blog is only half a blog. To disable com m ent ing for visit ors, log in t o ht t p: / / blogger.com and swit ch t o t he Set t ings t ab of your blog, and t hen t he Com m ent s subt ab. I n t he Who Can Com m ent field, select " Only m em bers of t his blog" from t he m enu. This can prevent com m ent ing, as long as you don't allow anyone t o becom e a m em ber. ( You can also select t he " Regist ered Users" opt ion; t his won't disable com m ent s, but it will st op anonym ous com m ent ing.) En a ble Com m e n t M ode r a t ion Anot her defense m easure if you face a lot of spam is t o enable com m ent m oderat ion. You will find t his set t ing next t o t he label " Enable com m ent m oderat ion" on t he Set t ings Com m ent s page, as pict ured in Figure 1012. Check t he Yes box, provide an em ail for com m ent approval request s t o be sent t o, and confirm your select ion by hit t ing t he Save Set t ings but t on. Now, whenever som eone t ries adding a new com m ent , you will get an em ail first , as pict ured in Figure 10- 13 . Only aft er clicking t he Publish link of t hat m ail will t he new com m ent go live.

    Th e se t t in gs pa ge for Blogspot blog com m e n t s

    Th e m ode r a t ion a le r t e m a il a sk s you t o a ppr ove a n e w com m e n t

    D isa ble Com m e n t s for a Spe cific Post Rat her t han t oggling t he global com m ent s set t ings for your blog, you can also sim ply disable t he com m ent s for a single blog post ing. I onut Alex. Chit u, who has a popular blog on Google at ht t p: / / googlesyst em .blogspot .com , says, " I f an old post get s m ore t han t hree t o four spam m essages in a day, I disable t he com m ent s for t hat post t em porarily." Here's how you can disable com m ent s for a specific older post of yours. Log in t o Blogger.com , find your blog on t he dashboard, t hen click t he Post s link t hat appears next t o t he " Manage: " prom pt . Locat e t he post in quest ion and click t he Edit link t o it s left . Expand t he set t ings for t he post via t he Post Opt ions link below it , as shown in Figure 10- 14 , and swit ch t o " Don't allow, show exist ing." Aft er hit t ing t he Publish Post but t on, your change will be act ive.

    Sw it ch in g t h e com m e n t s se t t in gs for a n in dividu a l post

    Ge t Em a il N ot ifica t ion s for N e w Com m e n t s I f you decide t hat t he m oderat ed com m ent s opt ion is eit her t aking up t oo m uch of your t im e, or rem oving t he feeling of real- t im e int eract ion in your blog's com m ent s, you m ight also want t o j ust get an em ail not ificat ion whenever a new com m ent is post ed. This way, when som eone post s a spam com m ent t o one of your post s, it will appear im m ediat ely but you will be alert ed t o it , and you can t hen delet e t he com m ent via t he Trash icon next t o it . To act ivat e t he not ificat ion opt ion, go t o t he Set t ings Com m ent s page for your blog. Ent er an em ail in t he bot t om field labeled Com m ent Not ificat ion Address and click Save Set t ings. H e lpfu l CAPTCH As By default , your blog is also prot ect ed by so- called CAPTCHAs, im ages displaying charact ers t hat t he user is t hen required t o t ype correct ly int o a box near t he im age, as shown in Figure 10- 15 . CAPTCHA is short for " Com plet ely Aut om at ed Public Turing t est t o t ell Com put ers and Hum ans Apart " but you can t hink of it sim ply as a way t o " capt ure" bot s, because t hey m ay not be able t o underst and t he im age, and t hus m ight fail at ent ering t he correct let t ers. The let t ers in CAPTCHAs are usually rat her dist ort ed t o increase t he barrier for t hose bot s able t o ut ilize Opt ical Charact er Recognit ion, so som et im es even hum an users will have a bit of t rouble passing t he t est t he first t im e. CAPTCHAs are enabled by default , but you can also disable t his feat ure anyt im e by t oggling t he checkboxes next t o t he label " Show word verificat ion for com m ent s" on t he com m ent s set t ings page.

    A CAPTCH A in a ct ion

    Th e " n ofollow " Va lu e Your blog is prot ect ed by anot her m echanism , t he rel="nofollow" at t ribut e value. This HTML at t ribut e different iat es a link post ed by you from a link post ed by a com m ent er, disabling t hat link's value t o search engine rankings. As a bet t er search engine ranking for t heir linked sit e is what m any spam m ers are aft er, t his m ay reduce t he incent ive for spam m ers t o post com m ent s t o your blog. Not e t hat you can't t urn off t he " nofollow" set t ing, as it 's a global value act ive for all Blogspot blogs.

    H a ck 9 9 . Add a Se a r ch En gin e t o You r H om e Pa ge For m any occasions, even t he best sit e navigat ion doesn't beat a quick sit e search. Make sure t o offer one for your sit e if it cont ains m any pages. When you creat e a web sit e wit h Google Page Creat or ( see t he int roduct ion t o t his chapt er) , unlike wit h a Blogspot blog, t here will be no sit e search engine added t o it aut om at ically. I t 's st ill possible t o add one m anually t hough using t he Google Cust om Search Engine ( CSE) program . This search allows your visit ors, as well as you, t o quickly find older pages host ed on t he sit e. Fin d Ou t W h e t h e r You r Sit e I s Alr e a dy I n de x e d For a Cust om Search Engine t o work as a sit e search, your web sit e m ust already be indexed in Google web search. Unfort unat ely, t here's no sim ple swit ch t o j ust act ivat e t his, as it m ay t ake days t o weeks, depending on t he popularit y of your web sit e [ Hack # 130 ] . To check whet her your sit e is available ( and if so, in what dept h) , perform t he following query at Google.com , replacing example wit h your act ual subdom ain: site:example.googlepages.com

    So, if your hom e page's URL is ht t p: / / officehacks.googlepages.com / globalwarm inginfo, you'd query Google for sit e: officehacks.googlepages.com or sit e: officehacks.googlepages.com / globalwarm inginfo. Se t Up You r Cu st om Se a r ch En gin e I f your sit e is indexed in Google, you can go about set t ing up a Cust om Search Engine for it . Point your browser t o ht t p: / / google.com / cse/ and click t he Creat e a Cust om Search Engine but t on. You will now be asked t o provide det ails like t he nam e for your search engine or it s descript ion. Provide t he fields as request ed, but do not ent er any value in t he " Search engine keywords" field. The next crucial part of t his form is t o provide your dom ain in t he " Sit es t o search" t ext field, sim ilar t o what is shown in Figure 10- 16 . Wit h t his value provided, you've t urned t he Cust om Search Engine int o your own sit e search service. Agree t o t he t erm s of service if you're OK wit h t hem , and click Next t o cont inue. On t he page t hat follows, click t he Finish but t on. You will be forwarded t o a page list ing your search engine. Click t he link reading " hom epage" next t o it . You will find a param et er nam ed " cx" in t he URL on t op, which you will need t o copy for t he next st ep. For inst ance, t he engine I j ust creat ed has t he following address: http://www.google.com/coop/cse?cx=014956320774661537761%3Avwo8c4t2l7s

    so I 'm copying t he value " 014956320774661537761% 3Avwo8c4t 2l7s" . This is t he ident ifier of t his cust om search engine.

    Se t t in g u p t h e Cu st om Se a r ch En gin e

    N OTE A CSE can be rest rict ed t o search t hrough a specific sit e ( t hat is, a dom ain or subdom ain) , but you can't rest rict it t o search specific pages or folders only. I f your Google Page Creat or sit e collect s several unrelat ed pages, it m ight m ake sense t o add a new sit e via t he " Creat e a new sit e" link on t he Page Creat or dashboard. This way, you can pick a separat e subdom ain.

    Add a Se a r ch Box t o You r Google Pa ge Cr e a t or H om e Pa ge Now it 's t im e t o add a search box t o your sit e. Swit ch over t o Google Page Creat or at ht t p: / / pages.google.com and click on your page t o launch t he edit or. Select an elem ent of your page where you want t o add t he search box. I 'm using a right hand navigat ion bar elem ent . Click " edit ht m l" below, and t ype t he t his HTML int o t he box—replacing t he cx value wit h your own value, but also replacing t he part in your ident ifier reading " % 3A" wit h a sim ple colon:





    Let 's go t hrough t he elem ent s of t his HTML snippet . The form elem ent set s up a web form t o receive user input . The action at t ribut e specifies which sit e t he form should be subm it t ed t o ( in t his case, t he Cust om Search Engine service) . The m et hod get t ells t he browser t o at t ach param et ers t o t he URL so t hat t he Cust om Search Engine will know what 's being searched for. The param et ers are t hen provided in t he p ( paragraph) elem ent ; an input field nam ed q for t he query, and a hidden input field nam ed cx for t he ident ifier of your cust om search engine. A subm it but t on wit h a label of your choice, such as " Search," is included as well. Once you've ent ered t he necessary HTML, click t he Updat e but t on. Now you can go live wit h your page by

    hit t ing t he Publish but t on, for a result sim ilar t o t he one pict ured in Figure 10- 17 . Not e t hat as t his search engine is hooked up t o Google's norm al web search index, pages t hat you freshly publish on your sit e m ay not appear in t he result s im m ediat ely.

    Th is sit e n ow h a s a sit e se a r ch in t h e side ba r

    H a ck 1 0 0 . Ge t a Ta st e of Blogge r 's Ex pe r im e n t a l Fe a t u r e s Unlock Blogger's video em bedding, gadget s and m ore. " Early adopt er" is what t he t echnology indust ry calls som eone who buys new gadget s first , signs up am ong t he first dozen people of every new web sit e, and in general considers som et hing " old- fashioned" aft er spot t ing a second person in t he neighborhood using it . Sounds cool, you say? Well, if you want t o be an early adopt er and you have a blog wit h Blogger.com , here's what t o do: inst ead of st art ing your blogging day at ht t p: / / blogger.com , m ove t o ht t p: / / draft .blogger.com . Alt hough t he design is slight ly different t han t he default , as shown in Figure 10- 18 , you will st ill be able t o blog as norm al. But you will also be able t o do m ore, because Blogger Draft , as it 's called, let s you experim ent wit h feat ures not available in t he default Blogger version. Here are a couple of t hese feat ures as of t his t im e ( not e t hat som e of t hese will be rolled out t o t he norm al Blogger over t im e, and new ones m ay be int roduced t o Blogger Draft ) :

    You can add Google Gadget s t o your blog [ Hack # 97] . Find t his in Layout s

    Add a Search box t o your t em plat e. Find t his in Layout s

    Add a Page Elem ent .

    Add a Page Elem ent .

    To read out about t he lat est feat ures available t o Blogger Draft users, check out t he official Draft blog at ht t p: / / bloggerindraft .blogspot .com .

    N OTE Looking for m ore blog widget s t o add? Visit ht t p: / / assessm yblog.blogspot .com and click on Blogger Hacks on t op; you will find ways t o add a widget cont aining t he t op com m ent ers for your blog, a widget showing popular post s of yours, and m ore.

    Blogge r D r a ft , sh ow in g t h e da sh boa r d vie w

    H a ck 1 0 1 . Ke e p a D iscu ssion Th r e a d a t t h e Top of t h e Gr ou p Put t he spot light on any discussion. A " st icky" t hread in a discussion forum is a t hread t hat will always appear at t he t op of t he list on t he overview page, even if m ore recent t hreads have appeared since t hen. I f you are t he group owner, you will find t his feat ure useful for direct ing at t ent ion t o cert ain t opics t hat you consider especially not ewort hy, or of special int erest t o new m em bers. You can m ake a t hread st icky in Google Groups if you have t he right access perm issions for t he group ( if you are t he original group owner—Google different iat es bet ween a group's regular m em bers, m anagers, and owners, which are roles t hat you as owner can assign t o ot hers) . For exam ple, I 've creat ed a group called Com ic Book Wat cher Group. Using t he Group Set t ings Appearance t ab, I 've given t he layout an overhaul, as pict ured in Figure 10- 19 . I 've also changed t he labels' order and t ext t o t he right side via t he Group Set t ings Navigat ion dialog. Plus, I 've m ade t he group privat e, so no one except invit ed m em bers will be able t o read t he discussions, or view t he files and pages t hat are post ed in t his group. To set a t hread t o be st icky, first click on t he t hread. On t op of it , you will find a link reading Opt ions. Clicking it expands t he set t ings; check t he " Display t his t opic first " box, as shown in Figure 10- 20 , and hit t he Save but t on.

    QUI CK HACK EXPERI MENT EVERYWHERE Google's web search has a sim ilar sect ion where you can play around wit h as- of- yet unreleased, or m erely prot ot ypical, feat ures. I t 's called Google Experim ent al and can be found at ht t p: / / google.com / experim ent al/ ( not t o be confused wit h t he Google Labs at ht t p: / / labs.google.com , t hough t hose m ight be of int erest t oo) . You can subscribe t o each search experim ent individually, such as being able t o see result s on a t im e line. I t will t hen show during your norm al web searching at Google.com .

    N OTE Not e t hat if you can't see t his checkbox, and you are logged in, you probably don't have m anagem ent perm issions for t his group; cont act t he group owner t o t ry set t le t his.

    When viewing t he t hreads overview, t his part icular discussion will now be on t op and show a push- pin icon, as pict ured in Figure 10- 21 . You can rem ove it s " st ickiness" st at us lat er on by t oggling t he checkbox select ion in t he opt ions dialog again.

    Th e gr ou p's fr on t pa ge

    Ex pa n din g t h e opt ion s dia log for a t h r e a d

    Th e discu ssion ove r vie w n ow sh ow s t h e st ick y t h r e a d on t op

    H a ck 1 0 2 . Blog Tr a n spa r e n t ly I ndicat e changes in your blog post and credit sources t o help m aint ain an effect ive conversat ion around your blog. Many consider it good blogging st yle t o t ell your readers when you m ake subst ant ial changes aft er an art icle of yours went live for som e t im e. This helps keep t he conversat ion t ransparent . For inst ance, im agine t hat som eone com m ent s on your art icle, and t hen you change it —t he com m ent m ay now appear odd because t he part of your post t hat it referred t o has since changed. The rule of " keeping it t ransparent " is especially applicable t o news blogs, less so for diary- st yle blogs or fict ion blogs.

    N OTE There are som e ways t o find out about changes m ade t o a blog post even if t he changes aren't disclosed [ Hack # 84] .

    A com m on indicat or for changed t ext is t o use a st riket hrough on t ext you replaced. To t ry t his, log in t o Blogger.com and when edit ing your post , swit ch t o t he Edit HTML t ab, as shown in Figure 10- 22 . Let 's say t hat you wrot e t hat George Washingt on was t he second U.S. president , but you've now realized t hat he was t he first . Use t he del ( delet ion) and ins ( insert ) t ags, as shown in bold: Code View: According to Wikipedia, George Washington was a central figure in the founding of the United States of America, and also the nation's second first president.

    Depending on t he t em plat e's st ylesheet , t his t ext could now appear in one of several different ways; t ypically, t he delet ion t ag will t rigger a st riket hrough, as shown in Figure 10- 23 . You can also j ust use t he s ( st riket hrough) t ag.

    Th e Edit H TM L t a b a llow s you t o m a k e a dva n ce d for m a t t in g ch a n ge s t o you r post

    A st r ik e t h r ou gh cor r e ct s a pa r t of you r a r t icle w h ile st ill sh ow in g w h a t you or igin a lly w r ot e

    Cr e dit in g You r Sou r ce Anot her good rule for t ransparency in blogs is t o t ell your readers where you first saw news or ot her it em s you are discussing. A " via" line like t he following at t he post 's end can be used, including a link t o t he original ar t icle: (Via CNN.com.)

    Now your readers can educat e t hem selves about t he kinds of sources you are using in your daily research, and t hey m ay also com pare your inform at ion wit h t he source inform at ion t o m ake up t heir own m ind. Addit ionally, using t he Edit HTML t ab, you can st yle t his " via" line a bit . You could use t he class via on a p ( paragraph) elem ent , as shown: Code View:

    (Via CNN.com.)



    By it self, t his will not change t he font when you publish t he post —you st ill need t o adj ust t he st ylesheet t o include a layout definit ion for t he via class. I n Blogger, click on Tem plat e on t op. Now select t he Edit HTML t ab. Scroll down in t he edit ing field t o where t he t em plat e cont ains t he st ylesheet definit ion; in m y t em plat e, t his part carries t he headline " / * Prim ary layout * / " , but t his m ay vary from t em plat e t o t em plat e. Add a st ylesheet definit ion like t his one, as also shown in Figure 10- 24 : .via, .via a { color: rgb(150,150,150) !important; }

    This inst ruct ion m eans: every elem ent t hat carries t he class nam ed via, as well as every a ( anchor/ link) elem ent wit hin, will receive t he color red = 150, green = 150, and blue = 150, and t his is im port ant , so override ot her definit ions in t he st ylesheet . Aft erwards, hit t he Save Tem plat e but t on. You can now view your blog post ing t o find t hat it includes your design changes, as pict ured in Figure 10- 25 . H a ck in g t h e H a ck I f you find yourself using t he " via" line described in t he previous sect ion—or any ot her HTML const ruct —in alm ost every blog post of yours, you can also t urn it int o a post t em plat e. I n Blogger, click Set t ings Form at t ing and scroll down t o t he Post Tem plat e field. Ent er t he base HTML needed t o creat e a new " via" link, as shown:

    (Via .)



    Click t he Save Set t ings but t on t o finish. This bit of HTML will now be included int o t he edit box by default whenever you st art a new blog post . You t hen j ust have t o fill in t he relevant part s—t he URL you want t o credit , as well as t he sit e's nam e—saving you som e t yping t im e. I n cases where you don't need t he HTML generat ed by t he post t em plat e, you can sim ply delet e it from t he post .

    M a k in g a st yle sh e e t ch a n ge in t h e t e m pla t e

    Th e pa r t r e a din g " Via CN N .com " is a ll gr a y n ow

    N OTE When picking a new class nam e, t ry t o find a word t hat describes what t he elem ent is, rat her t han how you w a n t it t o a ppe a r . The benefit is t hat when you decide t o m ake design changes lat er on, you will need t o edit t he single st ylesheet —but not all of your past post s! So, a class nam e like footer or warning or externalLink is m ore effect ive t han a nam e like smallGray or redUnderlinedParagraph. However, som et im es j uggling dozens of different class nam es can becom e com plicat ed, t oo. I f you want t o use a specific form at t ing for one post only, you m ay also decide t o use an inline st yle, like

    ...

    . ( Not e t hat t his st yle will now show in every m edium , even print —a pot ent ial downside t o inline st yles.)

    H a ck 1 0 3 . H ide t h e Blogspot N a viga t ion Ba r Go m inim al on your blog design. Every Blogspot blog by default receives a navigat ion bar on t op, wit h but t ons for swit ching t o t he next blog, searching your blog and m ore, as shown in Figure 10- 26 . Som e users m ay find t his navigat ion bar useful, but you m ay st ill want t o disable it —for inst ance, if you feel t hat disabling it would im prove t he layout of your blog.

    Th e Blogspot n a viga t ion ba r

    Before using t ools t hat m odify t he appearance of a web sit e you are using, it is your responsibilit y t o review t he m ost recent t erm s of service t o ensure t hat your act ivit ies do not conflict wit h t hose t erm s ( for exam ple, som e sit es require t hat you accept ads as part of t heir t erm s of use; ot her display elem ent s m ay be specified as well) .

    There is no m enu ent ry t o disable showing t he so- called Navbar, but you can st ill hide it . Just swit ch t o your Edit HTML. I n t he HTML source blog's t em plat e source by going t o t he dashboard page and select ing Layout t ext field, scroll down t o near t he end, and right before t he t ag, include t he following:

    What does t his m ean? Well, encloses st ylesheet inst ruct ions t hat define a page's layout ; plus, you'll be rest rict ing your inst ruct ions t o only t hose layout s t hat are delivered t o t he screen ( as opposed t o, say, t he print er) via t he media="screen" part . The act ual layout inst ruct ion is now t arget ing t he elem ent of t he I D navbar, which you define t o not display. The !important bit t ells t he browser t o override ot her layout definit ions for t his elem ent , if t hey exist . To save your am ended t em plat e, hit t he Save Tem plat e but t on. You can now check t he result by viewing your blog. I f t here's no navigat ion bar in sight , your hack was successful.

    N OTE I f t here st ill is a navigat ion bar showing, perhaps Google has since adj ust ed t he way t heir page design displays t he navigat ion bar. I f so, you m ay need t o read t he HTML source of your blog's page and adj ust your st ylesheet inst ruct ions accordingly. The Blogger navigat ion bar is also disabled when using FTP t o t ransfer t he blog pages t o your own dom ain, because t he navigat ion bar includes m any elem ent s t hat work only in t he cont ext of a BloggerPublishing—com es wit h it s own set of side host ed blog. However, FTP publishing—see Set t ings effect s, so a m ove should be carefully planned. Not e t hat in order t o swit ch t o FTP uploading, your blog m ust be public and use a classic t em plat e. ( You can set your blog t o be public via Set t ings Perm issions, and you can set your t em plat e t o classic at t he Tem plat e Edit HTML t ab.)

    H a ck 1 0 4 . M on it or a Th r e a d for N e w Post s When you cont ribut e a post t o Google Groups, t here m ay be a delay before it appears. Furt herm ore, responses t o t he post m ay t rickle in hours, days, or weeks lat er. How do you know when t hat happens? And what if a part icular t hread in your own group is so em ot ional t hat you'd like t o get an em ail whenever som eone adds som et hing t o it ? One way t o keep t rack of new Groups post s, whet her it 's your own group or one by som eone else, is t o check your profile page in Google Groups: it cont ains links t o all t he t hreads you've part icipat ed in or init iat ed. Go t o ht t p: / / groups.google.com , log in, and click Profile on t op. I n t he Recent Act ivit y box, follow t he linked t hreads t o check whet her t here's any news for you. Anot her and a m ore aut om at ed opt ion is t o subscribe t o em ail alert s for a t hread. However, t his approach works only for discussion groups host ed wit h Google, not t hose groups found on Usenet ( which Google also shows on Google Groups) . I f it 's a Google- nat ive group, t hen you will find a link reading Opt ions ( not t o be confused wit h t he link reading " More opt ions" ) at t he t op of each individual t hread. Click it and a m enu will open as shown in Figure 10- 27 . Click " Em ail updat es t o m e" and you're set . Blogger I onut Alex. Chit u from Rom ania adds a caveat , writ ing " Unfort unat ely, t he not ificat ions are som et im es delayed."

    Th e Google Gr ou ps t h r e a d opt ion s m e n u

    Ch a n ge D e t e ct ion Se r vice s How do you get em ail alert s for non- Google- nat ive discussion t hreads—all t hose on Usenet ? ( You can't sim ply subscribe t o a group's RSS feed, as it would show you every new m essage, not j ust replies t o your quest ion.) The answer com es in t he form of what is called a web page change det ect ion service. These services let you provide a couple of URLs, and will t hen em ail you whenever t he page in quest ion was updat ed. I f you provide t he Google Groups URL of t he Usenet t hread t o such a service, you will t hen be able t o t rack it . Here are a couple of different change det ect ion services, m any of t hem free, t o get you st art ed—not e t hat you can get creat ive and use t hese services for t racking m uch m ore t han j ust Google Groups:

    TrackEngine (ht t p: / / t rackengine.com )

    I nfoMinder ( ht t p: / / infom inder.com )

    ChangeDet ect ion ( ht t p: / / changedet ect ion.com )

    For inst ance, aft er regist ering wit h TrackEngine, you will be em ailed your password. Log in t o t he sit e using your em ail address and password, and you will be offered a bookm arklet t o add t o your browser [ Hack # 16] . This bookm arklet will read " Track m e! " —press it when you're viewing t he Google Groups t hread in quest ion ( Figure 10- 28) . A pop- up window opens ( you m ay be required t o log in again) . Swit ch t o t he Expert t ab, disable t he " Use cookies" opt ion at t he bot t om ( ot herwise, TrackEngine runs int o t roubles) , and click OK. You will now be alert ed via em ail whenever a response t o t he t hread is post ed.

    H it t in g t h e " Tr a ck m e !" bu t t on

    H a ck in g t h e H a ck We m ent ioned earlier how it 's im possible t o sim ply subscribe t o a group's feed in order t o find replies t o one specific t hread, as t hat feed would cont ain post s t o any t hread in t he group. However, wit h a lit t le Yahoo! Pipes m agic, you can act ually filt er an RSS feed for specific words, t o t hen creat e a second feed showing j ust t he it em s you want ( in t his case, j ust t he replies t o t he t hread you're wat ching) . First , log in t o Yahoo! Pipes at ht t p: / / pipes.yahoo.com . Next , creat e a new pipe like t his:

    1 . Under Sources, drag " Fet ch Feed" t o t he work area and specify t he URL of t he group's XML feed.

    2 . Under Operat ors, drag a Filt er t o t he work area, specify " Perm it it em s t hat m at ch all of t he following," and set item.title t o t he subj ect of t he t hread.

    3 . Connect t he source t o t he filt er, and t he filt er t o t he out put , as shown in Figure 10- 29 . Save t he new Pipe, click Back t o My Pipes, and click on your new pipe t o find it s RSS feed.

    Now, subscribe t o t he pipe's RSS feed in your feed reader t o be not ified of new post s t o t he t hread. You m ay

    want t o clone and adj ust t his pipe—which we st ored at ht t p: / / blogoscoped.com / googleappshacks/ link/ m onit or —if you want t o subscribe t o m ult iple t hreads. — Brian Jepson and Philipp Lenssen

    Se t t in g u p t h e Ya h oo! Pipe

    H a ck 1 0 5 . H ide t h e Ads in You r Google Gr ou p Bat t le inform at ion overflow by hiding ads. I f you m aint ain or visit a Google group ( see t he int roduct ion t o t his chapt er) , t here m ay be ads showing on t he right side of som e discussion t hreads. Alt hough you can't disable t hem globally for all users—even if you are t he owner of t he group—you can disable t hem for yourself if you use t he Firefox browser.

    Before using t ools t hat m odify t he appearance of a web sit e you are using, it is your responsibilit y t o review t he m ost recent t erm s of service t o ensure t hat your act ivit ies do not conflict wit h t hose t erm s—for exam ple, som e sit es require t hat you accept ads as part of t heir t erm s of use; ot her display elem ent s m ay be specified as well.

    To get Firefox, st art out at ht t p: / / firefox.com . Once you've got t hat inst alled, t here is an add- on for Firefox called Adblock Plus; you can get it by visit ing ht t ps: / / addons.m ozilla.org/ en- US/ firefox/ addon/ 1865. Click t he I nst all Now but t on and follow t he inst ruct ions. You m ay be required t o rest art your browser. When Firefox st art s up again, pick one of t he available filt er list s, as shown in Figure 10- 30 . The first one in t he list includes set t ings t o disable Google AdSense ads, for inst ance, which are t he ones being used over at Google Groups t oo.

    Th e Adblock Plu s con figu r a t ion dia log a ft e r in st a llin g

    Now you will not ice a st op sign icon in t he t op right of your browser. I f your filt er is inact ive, it will be gray, as shown in Figure 10- 31 . I f act ivat ed, t he icon will be red and m any ads are being disabled, as shown in Figure 10- 32 wit h t he sam ple com ic book discussion group.

    Th e Google Gr ou ps pa ge w it h a ds

    Th e sa m e pa ge w it h ou t a ds, t h a n k s t o Adblock Plu s

    H a ck 1 0 6 . Tr a ck W h o Lin k s t o You r Blog Post s Feedback helps shape your blog—find it . Every blog post of yours can be a part of a larger conversat ion. Perhaps you've writ t en som et hing in react ion t o anot her blog art icle, and now som eone else cont inues t he discussion and writ es som et hing at t heir blog in react ion t o your post . To keep t rack of t he " replies" you are get t ing t his way, you can discover post s by ot hers t hat include a link t o your post . To check for t hese backlinks, you can use Google Blog Search at ht t p: / / blogsearch.google.com . Not e t hat it won't show all links, but it will show som e. When searching, use t he link operat or as in t he following query exam ple , where "ht t p: / / exam ple.com / 323.ht m l" would be t he perm alink t o your blog ent ry: link:http://example.com/323.html

    N OTE I f you om it t he link operat or, Google Blog Search st ill knows what you m ean and will add it aut om at ically.

    You will now get a list of blog art icles discussing your art icle, sim ilar t o what is shown in Figure 10- 33 . Click t he link reading " Sort by dat e" in t he t op right t o get t he lat est react ions first ; ot herwise, Google will order result s by relevance. Not e t hat you can subscribe t o t hese backlinks result s via t he At om / RSS links on result pages. To get a m ore general list of recent react ions t o your blog, you can also sim ply ent er your hom e page's URL: link:http://example.com

    Anot her backlinks t racking t ool is Technorat i.com . When visit ing t he sit e, j ust ent er your blog post 's URL int o t he search box and hit t he Search but t on. Som e of t he URLs will be t he sam e as t he ones Google Blog Search finds, and ot hers m ay be new.

    Google Blog Se a r ch t r a ck s t h e lin k s ba ck t o you r blog

    Usin g Blogge r 's Ba ck lin k s Fu n ct ion Blogger also offers you a way t o show backlinks t o your post s right below each post . To enable t his feat ure, click on Set t ings Com m ent s at Blogger.com . I n t he sect ion labeled Backlinks, select Show. Approve t he dialog by clicking Save Set t ings at t he bot t om .

    N OTE Ot her blog syst em s, like Wordpress.com , also have a feat ure called " t rackback" t o allow bloggers t o not ify your blog syst em when t hey discuss a post of yours. This will t hen result in t he link t o t hem being shown below your blog post , as wit h Blogger's Backlinks funct ion. The downside t o t rackbacks is t hat som e people m ight ping your blog's t rackback syst em even when t hey don't discuss your post , j ust so t hat t hey generat e a link t o t heir sit e in ret urn t o increase t raffic. ( The Blogger Backlinks feat ure t oo som et im es falls prey t o t hese " spam m ers." ) At t he t im e of t his writ ing, Google's Blogger does not support t rackbacks.

    H a ck 1 0 7 . Qu ick ly Sh a r e You Tu be Vide os on You r Blog Be as lazy as possible when em bedding YouTube videos. I f you have a Blogger.com blog and you em bed a video from YouTube.com every now and t hen, you can click t he " add video" icon during publishing, as shown in Figure 10- 34 . However, if you are a m ore regular video blogger—post ing m any of your own videos t o YouTube, or frequent ly em bedding ot her people's videos—you can speed up t his st ep. On t he YouTube video page, click t he Share link, as shown in Figure 10- 35 . A dialog will expand below t he video wit h a link reading " Set up your blog for video post ing." Click it and you'll be forwarded t o a configurat ion page. Hit t he Add a Blog/ Sit e but t on, pick Blogger as your blog provider—not e t hat t his hack also works wit h som e ot her blog providers, like LiveJournal and WordPress—and ent er your Blogger usernam e and password, sim ilar t o what is shown in Figure 10- 36 . A dialog page will now display reading " Fet ching your inform at ion. Please Wait ." Aft er som e seconds, you will be asked t o pick t he blog you want t o add ( if your account cont ains m ore t han one blog) . Make your select ion and click Add Select ed Blogs. Now, when you click t he Share link on a YouTube page t he next t im e, you can im m ediat ely share t he video by clicking Post t o Blog, as pict ured in Figure 10- 37 . By default t he new post being creat ed on your blog will also carry t he YouTube video's t it le, as shown in Figure 10- 38 ; ent ering addit ional descript ive t ext for your post is opt ional.

    Blogge r 's vide o e m be d bu t t on

    Th e Sh a r e lin k be low You Tu be vide os

    Pr ovidin g you r Blogge r a ccou n t cr e de n t ia ls

    Post in g a You Tu be vide o t o you r blog

    Th e vide o is n ow e m be dde d on t h e Blogspot blog

    H a ck 1 0 8 . Ge n e r a t e Te x t I m a ge s I f you're a genius wit h Phot oshop or sim ilar t ools, you can skip t his hack, but if not , here's how t o m ake t ext wit h special effect s. When you don't have an im age t o your blog post and you can't find a fit t ing Creat ive Com m ons licensed im age eit her [ Hack # 31] , you can also generat e a new im age online. One opt ion is t o creat e an im age of a t ext t hat describes your post 's cat egory, like " Misc. Links," " Fun Sight ings," " Tips & Tricks," " Rant ," " Polit ics" and so on. You can also use such an im age t o add a signat ure t o your post . Generat ing t ext im ages can be helpful for a hom e page, like one creat ed wit h Google Page Creat or, t oo. A variet y of t ools and services are available.

    N OTE You can also use t he I m ageMagick t ool described in [ Hack # 38] t o creat e 2D t ext effect s. For m ore inform at ion, see ht t p: / / www.im agem agick.org/ Usage/ font s/

    Ge n e r a t e a Sign a t u r e Provided t hat you have a scanner, you can sign a paper, scan it , crop t he pict ure, and add it t o your post —t he downside being t hat everyone is now able t o swipe your signat ure. An alt ernat ive approach is t o generat e a signat ure online. To do so, head over t o ht t p: / / m ylivesignat ure.com / m ls_wizard1_1.php and ent er your nam e. You also need t o answer a securit y quest ion. Click Next St ep, and you will be able t o choose from m ore t han 100 different signat ure st yles, spread out across different pages, as shown in Figure 10- 39 . Aft er you've select ed an im age, t he signat ure creat ion wizard has you choose a font size, color, and signat ure slope. Approve your select ions and you will end up wit h a signat ure im age. Right - click it t o copy it t o your disk; you can now upload it when creat ing a new blog post ( see Figure 10- 40 ) .

    Pick in g a fon t a t M y Live Signa t ur e .com

    Th e PN G im a ge a s in clu de d in t h e blog post con t a in s a t r a n spa r e n t ba ck gr ou n d t o sm oot h ly ble n d in w it h diffe r e n t de sign s

    Cr e a t e 3 D Te x t A free t ool t o generat e t hree- dim ensional t ext is available at ht t p: / / wafu.ne.j p/ 3dlogo/ e3dlogo.ht m l. You can input your words of choice and t hen t oggle an abundance of opt ions. Get t ing t he right result will t ake som e fiddling around wit h t he opt ions and get t ing used t o t he int erface, and not every im age will look good, but if you're shoot ing for a 3D effect sim ilar t o what is shown in Figures 10- 41, 10- 42, and 10- 43, t his t ool m ay be for you. Cr e a t e 2 D Te x t At ht t p: / / int eract im age.com , you can also creat e an im age out of different font s for use in your blog or hom e page. Just ent er som e t ext in t he box below t he preview canvas and hit t he Creat e but t on, as shown in Figure 10- 44. A variet y of set t ings t o t he right let you fine- t une your result . I f you don't know which font t o go for, explore t he choices by clicking Font Finder. Once you're done wit h your im age, right - click it t o save it .

    H a ck s

    Office H a ck s

    M or e H a ck s

    Th e Fon t I m a ge Ge n e r a t or e dit or

    H a ck 1 0 9 . Blog via Em a il There is m ore t han one way t o creat e a blog post . Google Docs [ Hack # 11] isn't t he only way t o blog out side of Blogger's nat ive edit or ( see Chapt er 10) ; you can Set t ings Em ail and ent er your own also blog via em ail. Just go t o your blog's em ail opt ions at Blogger word next t o t he " Mail- t o- Blogger Address" field. Check t he Publish checkbox and save t he set t ings, as shown in Figure 10- 45 . Now you can go t o Gm ail or what ever em ail client you use, and writ e a new m ail t o your m ail- t oblogger address ( such as t o officehacks.secret [email protected] ) as pict ured in Figure 10- 46 .

    Make your secret word for t he m ail- t o- blogger em ail address som et hing t ough t o guess, and change it from t im e t o t im e. Ot herwise, a m alicious person could creat e new post s on your blog wit hout your perm ission. You can t hink of t his cust om word as a password, but t o be m ost secure, it 's advisable t o not reuse a password you use elsewhere for t his; you should pick som et hing unique.

    Se t - u p you r m a il- t o- blogge r a ddr e ss

    Com posin g a r ich t e x t m e ssa ge in Gm a il; t h e m a il su bj e ct w ill t u r n in t o t h e blog post t it le

    H a ck 1 1 0 . Ou t sou r ce You r Kn ow le dge Ba se H ost in g Avoid having t o set up and m aint ain your own int ranet wiki and forum . Google Groups can be useful for business; you can creat e privat e knowledge bases full of developm ent resources and use Google's t echnology and servers t o host and search it . Google Groups' access cont rols let you creat e a knowledge base wit h access lim it ed t o yourself, your com pany, or a set of colleagues. I 've creat ed a privat e group for each t echnology I use ( current ly one for Google code and one for C# developm ent ) . I 've invit ed each of m y st aff t o becom e part of t he group and encourage t hem t o post clever resources like code snippet s, and t o ask ( and answer) t ech quest ions wit hin t he forum s. I also m ake sure t hat everyone forwards em ail chains wit h problem s/ solut ions int o t he discussion forum . Because access is lim it ed t o t he people you invit e, you can post sensit ive com pany quest ions/ answers/ code snippet s/ binaries wit hout fear of public disclosure.

    I f you plan t o access Google Groups from unt rust ed net works ( such as public wireless hot spot s) , be sure t o access it via t he SSL prot ocol: use t he ht t ps: / / groups.google.com / group/ yourgroupnam e URL inst ead of ht t p: / / groups.google.com / group/ yourgroupnam e.

    Also, t he cent ralized archive m eans t hat all t he m em bers have access t o t he sam e inform at ion as soon as t hey've been given access—no m ore archives and forwarding m ailing list em ails t o new st aff. File host ing gives you som ewhere t o st ore cool icons, useful t oolkit s, or t hird- part y resources. The " Pages" ( t hink of it as your wiki or docum ent at ion) sect ion gives you som ewhere t o put com pany docum ent at ion, like coding guidelines, nam ing convent ions, FAQs, and so on. The docum ent s are collaborat ive and revisioncont rolled ( like a wiki) so st aff can updat e t hem as required and everyone can see what 's changed and when. Here are som e t ips t hat you m ight find helpful:

    St r u ct u r e you r docu m e n t s. By select ing " Rearrange your docum ent s" in t he " docum ent s" sect ion, you can st ruct ure your docum ent s int o a sensible hierarchy. " Sub- docum ent s" will be indent ed underneat h t heir parent and will be shown when you view t heir parent . Hierarchies can go m ult iple levels.

    Add you r pr odu ct or com pa n y logo. Each group let s you include a logo t hat will be displayed on t he t op left and in t he list ings.

    D iscu ssion post s via e m a il. I f you have an em ail discussion wit h som eone t hat covers t echnical det ails or any ot her useful inform at ion, bcc ( blind carbon- copy) or forward t he conversat ion t o t he appropriat e knowledge bases. You can get t he em ail address at t he bot t om of t he full discussions list ( next t o t he XML feed icon) .

    M a k e sou r ce code r e a da ble . I f your knowledge base is going t o feat ure a lot of code snippet s, set t he default view t o proportional font in t he appearance t ab of t he group set t ings.

    N OTE Anot her way t o set up a knowledge base for your com pany is Google Sit es [ Hack # 112 ] .

    — Ret o Meier

    H a ck 1 1 1 . Te st You r W e b Sit e in Ot h e r Br ow se r s You m ay have only a single com put er physically, but virt ually, you can see m ore. When you t weak your design by edit ing t he st ylesheet or HTML yourself, you m ay want t o t est t he result on different operat ing syst em s and browsers, because for bet t er or worse, not every browser will render your page t he sam e; oft en, different browsers or versions of t hose browsers do not support one or anot her elem ent , or t hey m ay int erpret it different ly. For Windows users, a great t ool t o check your sit e on different syst em s and browsers is BrowserPool ( Mac and Linux versions m ay com e in t he fut ure, t he service says) . You can get it at ht t p: / / browserpool.de/ kc/ wob/ port al.j sp?lang= en . Click t he Free Test Account link t o regist er ( see Figure 1047) ; ent er a usernam e and password, along wit h your em ail address, and hit Subm it . Check your em ail inbox t o click t he confirm at ion link t hat was sent t o you ( you m ay need t o check your spam folder, t oo, if you don't find t he m ail from BrowserPool right away) .

    N OTE Mac and Linux users m ay want t o run a virt ualizat ion environm ent such as VMware or Parallels. Alt hough t his requires a Windows license t o inst all Windows under t he environm ent , you should be able t o use BrowserPool from wit hin t he em ulat ed version of Windows t o t est all t he ot her versions of Windows you want t o use.

    Re gist e r in g w it h Br ow se r Pool

    Aft er confirm ing your new account by clicking t he link in t he em ail, you will be able t o download brow serpool.exe. Run t he execut able t o inst all t he program . Once you st art BrowserPool, you can choose bet ween a variet y of operat ing syst em s and set t ings, as shown in Figure 10- 48 . Pick one and a new window opens wit h your syst em of choice, as shown in Figure 10- 49 . You can now fire up a browser wit hin t hat syst em t o check your blog or hom e page. I f t here are any rendering issues wit h your t em plat e am endm ent s, you can now go about fixing t hem .

    Th e Br ow se r Pool clie n t offe r s diffe r e n t ope r a t in g syst e m s w it h diffe r e n t br ow se r s

    Usin g Br ow se r Pool t o t e st h ow a blog la you t r e n de r s on M a c OS X w it h Sa fa r i

    H a ck 1 1 2 . Ge t a ( Google ) Sit e Wit h som e t echnical knowledge, you can set up cust om Google Apps for your organizat ion or t eam ( or privat e use) , and creat e a Google Sit e. Google Sit es (ht t p: / / sit es.google.com ) is a cont ent m anagem ent syst em t hat includes wiki- like feat ures ( like visual on- page edit ing) as well as proj ect m anagem ent t ools ( like t he creat ion of t ask list s) . I t 's m ore advanced t han Google Page Creat or, but also requires a Google Apps account ( as opposed t o a regular Google account ) —and a Google Apps account in t urn requires you t o have your own dom ain. Sign in g Up w it h Google Apps What 's a Google Apps account ? Google Apps ( ht t p: / / google.com / a/ ) , form erly called Google Apps for Your Dom ain, is a service t hat Google offers for businesses, st udent s, schools, and organizat ions t o set up Googlepowered applicat ions like Gm ail, iGoogle, Google Docs, and m ore. An adm inist rat or for t he dom ain can t hen configure t hese t ools in cert ain ways, like set t ing up a cust om ized design for t he iGoogle page. Even wit h Google Apps, t he dat a will st ill be st ored at Google in t he " cloud." Upsides include not having t o m anage backups and soft ware updat es yourself. A pot ent ial downside is t hat t he dat a is shared wit h anot her organizat ion—Google, I nc.—who in som e cases, as is t rue wit h anyt hing st ored wit h your regular Google Account t oo, m ay even be obliged t o share dat a wit h governm ent agencies ( see links t o t he respect ive privacy policies at ht t p: / / google.com / a/ help/ int l/ en/ users/ privacy.ht m l) . Google Apps com es in st andard, prem ier, and educat ion edit ions. The prem ier edit ion cost s $50 per user account per year ( at t he t im e of t his writ ing) , but t he st andard edit ion is free t o use. To sign up for t he st andard edit ion, point your browser t o ht t p: / / google.com / a/ cpanel/ dom ain/ new. I f you already have a dom ain, you will be required t o ent er it in t he left field, as shown in Figure 10- 50 ; if you don't have a dom ain yet , swit ch t o t he right hand t ab by clicking " I want t o buy a dom ain nam e" or get a dom ain nam e elsewhere ( querying Google web search for " dom ain" , " get dom ain" , " host ing" , " dom ain host ing" , or sim ilar ret urns som e of t he available providers) .

    St e p 1 of 3 for se t t in g u p a Google Apps a ccou n t

    Aft er you've ent ered your dom ain int o t he form —I ent ered " blogoscoped.com " back in Figure 10- 50 —click t he Get St art ed but t on, and com plet e t he regist rat ion form t hat follows, as shown in Figure 10- 51 . Anot her form

    follows request ing you t o provide an adm inist rat or usernam e and password, and t o accept t he Term s and Condit ions. I f you do, click " I accept ." You will now be forwarded t o your Google Apps dashboard, as shown in Figure 10- 52 , and it 's t im e t o verify t hat you are indeed t he dom ain owner. Click " Verify dom ain ownership" t o choose from t he available m et hods t o do so. I n m y case, I 'm picking " Upload an HTML file" from t he com bo box; Google now hands m e a verificat ion code, which I 'm past ing anywhere int o a new file nam ed googlehost edservice.ht m l. I 'm t hen uploading t hat file t o t he root of ht t p: / / blogoscoped.com ( please consult your web host support if you're unsure how t o upload t his file t o your server's docum ent root ) . Aft er you st art t he verificat ion by hit t ing t he Verify but t on, Google will alert you t hat it m ay t ake 48 hours t o com plet e.

    St e p 2 of pr ovidin g you r in for m a t ion for Google Apps

    You r Google Apps da sh boa r d, a la u n ch pa d t o m a n a ge t h e Google Apps offe r in gs lik e Google D ocs, Ca le n da r , Ch a t , a n d Google Sit e s

    From t he dashboard, you can now add services t o your Google Apps, or cust om ize t he exist ing ones. For inst ance, I edit ed t he logo font colors of t he cust om iGoogle page ( which in t his case is locat ed at ht t p: / / part nerpage.google.com / blogoscoped.com ) , as shown in Figure 10- 53 .

    N OTE I f you can fully adm inist er your server, you can change t he dom ain t hat users visit t o get t o t heir iGoogle st art page. You'll need t o creat e what is called a CNAME record, and which is furt her explained at ht t p: / / google.com / support / a/ bin/ answer.py?answer= 47283.

    A cu st om iGoogle h om e pa ge for Google Apps u se r s

    Se t t in g Up You r Google Sit e

    Once you set up your Google Apps account , you will find your Google Sit es hom e page at ht t p: / / sit es.google.com / a/ exam ple.com ( replace exam ple.com wit h your act ual dom ain) . During your first visit , click t he Creat e a Sit e but t on. Provide your sit e nam e, cat egories, a sit e descript ion, a t hem e, and m ore. There are m any t ypes of sit es you can creat e, like t he hom e of a local book reading club, a st art page for your com pany's int ranet , t he hom e page t o a soft ware proj ect , or a page cont aining your biography, resum e, and pict ures. Sit es can be edit ed by a t eam , or by a single person; t hey can be m ade public, or invit e- only. Take a look at Google's sam ple proj ect , " Mrs. Richau's Classroom ," at ht t p: / / sit es.google.com / a/ googleclassroom s.org/ m rs- richau/ Hom e, t o get an idea of what 's possible wit h Google Sit es. As shown in Figure 10- 54 , I 'm creat ing a sam ple sit e nam ed " Joey's JavaScript Tut orials," offering code downloads, t ut orials, and helpful point ers. Click Creat e Sit e and you will be dropped on your new sit e's hom e page. Out side visit ors will see a norm al web sit e, but as you are logged in as adm inist rat or, you will now see special but t ons print ed on t he pages for edit ing pages, creat ing new pages, or accessing special feat ures, as shown in Figure 10- 55 . When you creat e a new page, you are able t o choose bet ween a variet y of page t ypes and subt ypes; for inst ance, you can creat e a List nam ed " Overview of All JavaScript Funct ions" and t hen set up t he subt ype " Cust om List " ( see Figure 10- 56 ) . You can also click Sit e Set t ings on t op t o adj ust global configurat ions any t im e, like your sit e's overall layout .

    Se t t in g u p a n e w Google Sit e s sit e

    Click in g t h e Edit bu t t on t a k e s you in t o a W YSI W YG e dit in g m ode for t h e give n pa ge

    A cu st om list pa ge st a r t s colle ct in g in for m a t ion on Ja va Scr ipt fu n ct ion s. An a t t a ch m e n t ( a le r t .r a r ) w a s a dde d a s w e ll.

    H a ck 1 1 3 . Tu r n You r Blog I n t o a Book The digit al world is great for quick and t im ely info, but you m ight want t o produce som et hing of longer value t hat you can also physically pass on. Have you added new post s t o your blog at a regular basis over m ont hs or years, perhaps even on a single cont inuous t opic? I f so, you m ight want t o consider t urning your blog int o a book. I 'm not referring t o an ebook, eit her—t hough t hat 's a possibilit y as well—but an act ual print ed book. This can m ake a great gift , and it m ay also earn you som e spare change ( or m ore) in com m issions. A while ago, a service called BlogBinders allowed you t o t urn your Google Blogspot blog sem i- aut om at ically int o a book. I was able t o use it m yself while t he service last ed, but unfort unat ely t he com pany has gone out of business now and closed shop. But t here's anot her service available t hat can achieve t he sam e goal: Lulu.com . I f you visit t he sit e, shown in Figure 10- 57 , you will learn t hat it allows you t o creat e and sell your cont ent as paperback books, hardcover books, phot o books, brochures, calendars, post ers, and m ore. Pr in t on D e m a n d—H ow Lu lu .com W or k s Here's how Lulu works. You have cont ent in a digit al form at t o which you own t he copyright . You can now regist er wit h t he sit e and upload your docum ent as a Word docum ent , or anot her accept ed form at . Your file will be convert ed t o PDF, which you can check for layout consist ency. I f you approve t he change, you can st art selling t he book t hrough t he sit e. I t will be print ed on dem and, and for every successful order, you will get a com m ission based on t he price you det erm ine t o set yourself ( t hough base cost s as well as Lulu's com m ission will be subt ract ed) . Addit ionally, you can buy an advanced dist ribut ion package at Lulu. This will get your book an I SBN, t he bar code shown on books sold at book st ores t hat represent s t he I nt ernat ional St andard Book Num ber. Plus, t he book will t hen be added t o Am azon.com and available t o ot her dist ribut ors.

    Th e Lu lu h om e pa ge

    Th e Te ch n ica l St e ps for t h e Blog- t o- Book Con ve r sion I f t he Lulu.com principle sounds easy, indeed it is relat ively easy; however, preparing t he cont ent t o be in t he right form at for convert ing it t o a Lulu book can be rat her challenging. I n m y experience, unless you know how t o produce pict ure- perfect PDF files yourself using professional t ools, preparing t he cont ent works best if you're working wit h an English version of Microsoft Word. Unfort unat ely, due t o t he nat ure of Lulu.com , I found t hat com pet ing product s like OpenOffice.org ( and even non- English versions of Microsoft Word) can bring wit h t hem conversion headaches at a lat er point . Lulu offers you book t em plat es t o st art wit h; give t hem a t ry. You m ay also want t o give doing t his wit h Google Docs a shot , t hough [ Hack # 1] . I f you set t led for a word processor whose out put works wit h Lulu, it 's t im e t o go about im port ing your blog. One of t he best approaches for t his is t o ident ify which blog post s ought t o m ake it int o your book by finding t hose t hat have a longer shelf life, or t hat don't cont ain t oo m any crucial links, or t hat are especially well- writ t en or researched. Once you've locat ed each post , you can copy and past e it s t ext int o your word processor. Aft er repeat ing t his process chapt er by chapt er, and preparing a fit t ing cover illust rat ion for your blog [ Hack # 31] , you need t o check whet her t he layout of your book survives t he conversion t o PDF. Once it looks good, you can send yourself a review copy, which m ay t ake several days. I f t he print ed book looks good, t oo, you can approve t he book t o go live for sale t o t he public ( I did t his wit h m y book 55 Ways t o Have Fun wit h Google, which you can also fully download for free at ht t p: / / 55fun.com ) . The final PDF generat ed for you m ight also m ake for a good ebook. H ow t o W r it e Blog Post s t h a t St a n d t h e Te st of Tim e Here are som e t ips t o help ensure t hat your blog post s will be as useful in t he fut ure as t hey are t oday. These t ips are useful bot h for t urning your blog int o a book at a lat er point , as well as opt im izing t he value of your blog as an archive in general:

    Writ e about t hings t hat you have personal experience in, or t hat you t hink m ay be of m ore general int er est .

    I f you link t o inform at ion crucial t o get t ing your post 's point across, also sum m arize t he inform at ion in your own words in t he post it self. This way, should t he ext ernal sit e go down or becom e ext inct —or t he link can't be m ade act ive, such as in book form —your post is st ill useful.

    I f you t alk about an ext ernal sit e in your blog post , use a screenshot of t hat sit e t o illust rat e your point . Doing so will ensure t hat your art icle can be underst ood if t he ext ernal sit e is rem oved or changed.

    Clarify your point by being precise and adding det ails. Som et im es, t his even m eans st at ing what m ay be obvious t o you. Ot herwise, t he in- j oke of t he day m ay not be underst ood by readers—perhaps not even yourself! —som e years ahead.

    Use a spellchecker program for your post s. This way, t hey becom e m ore readable. This is especially useful if you convert t he blog art icles t o a book chapt er; t hough people m ay be used t o one or t wo spelling errors in a blog post , we usually expect a m uch lower frequency in books.

    Writ e about a single t opic or set of t opics. Over t im e, t his will t urn you int o an expert in t hat field, rendering your art icles all t hat m ore valuable ( we all like expert advice) . Also, t his will m ake it easier t o t urn your blog int o a book, as t he book will now have a single t hem e.

    Use self- explanat ory, precise t it les for your post s. Ot herwise, you m ight have a hard t im e digging t hrough your archive t o find m at erial for your book.

    H a ck 1 1 4 . Be yon d Google : Fr om W or dPr e ss a n d Fr ie n dFe e d t o Ya h oo's Ge oCit ie s I f you feel rest rict ed by Blogspot , Google Page Creat or, or Google Groups, look beyond t hese offerings—t here are loads of good ( and part ly free) alt ernat ives around. Before deciding which t ool is right for you, underst and what you're aft er: a blog, a regular hom e page, or a discussion forum . A regular hom e page is bet t er for a few st at ic pages, whereas a weblog is ideal for frequent addit ions or regularly updat ed inform at ion. I f you m ainly want t o supply a place for a com m unit y inst ead of writ ing, a forum m ay be t he way t o go. And som et im es, m ixing and m at ching am ong t he t hree is also a good solut ion—like a web sit e t hat com bines blog and forum . Bloggin g Soft w a r e Blog edit ors can be divided int o t wo cam ps, roughly: t hose t hat run on som eone else's server, wit h no soft ware m anagem ent needed on your end, and t hose running on your own server, requiring a bit m ore adm inist rat ion knowledge. ( And t hen, t here's a dividing line bet ween free and paid blog syst em s.) One of t he m ost popular blogging plat form s is WordPress. You can eit her download t he necessary files from ht t p: / / w ordpress.com t o do your own host ing, or get a host ed blog wit h t hem on a URL like ht t p: / / yournam e.wordpress.com . I t t akes only seconds t o regist er wit h WordPress. Then you can click t he New Post but t on on t op, and subm it a post wit h t he edit or as pict ured in Figure 10- 58 . The result using t he default t em plat e is shown in Figure 10- 59 .

    Th e W or dPr e ss blog post e dit or

    A pu blish e d post , h ost e d a t W or dPr e ss.com

    Tum blr ( ht t p: / / t um blr.com ) is also a blogging t ool, wit h a refreshingly clean int erface support ing quick t ext blogging or sharing of phot os, videos, audio, and m ore ( som e also call t hese blog form at s " m icroblogs" or " t um blelogs" t o em phasize t heir scrapbook nat ure) . Your URL aft er free signup will be ht t p: / / yournam e.t um blr.com . Anot her opt ion for a host ed blog t ool is TypePad ( ht t p: / / t ypepad.com ) , wit h your blog URL being yournam e.t ypepad.com . You can st art out wit h a free 14- day t rial, t hough even t his t rial will require you t o provide your credit card inform at ion. Aft er t he t wo weeks, you can decide if you want t o cont inue wit h t he paid version of t he service. At t he t im e of t his writ ing, TypePad pricing st art s at $4.95 per m ont h, becom ing m ore cost ly wit h higher m em bership levels.

    When you regist er for a TypePad t rial, not e t hat by default you will be added t o t he TypePad updat es and special offers newslet t er. What 's m ore, if you need t o am end inform at ion in t he form —for inst ance, because you picked a usernam e t hat exist s already—t he checkbox select ion will always revert t o you being subscribed t o t he newslet t er, even when you unchecked it before. I f you don't want t o receive t he newslet t er, m ake sure t o uncheck t he box every t im e you subm it t he form .

    The nonhost ed sibling of TypePad, creat ed by t he sam e com pany ( Six Apart ) , is called Movable Type. For personal uses, Movable Type is free t o download; a com m ercial, support ed license can be acquired st art ing at $295.95 ( see ht t p: / / m ovablet ype.com ) . Anot her opt ion is t o get t he Movable Type Open Source version, which can be used for personal and com m ercial endeavors alike ( see ht t p: / / m oveablet ype.org) . LiveJournal at ht t p: / / livej ournal.com is anot her blogging opt ion, wit h free as well as paid m em bership levels. More t han ot her services, LiveJournal em phasizes com m unit y feat ures like finding new friends. Aft er regist ering wit h t hem —uncheck t he " occasionally em ail m e LiveJournal updat es" box unless you want t hose m ails—you can st art adding blog post s, polls, and m ore t o a URL like ht t p: / / usernam e.livej ournal.com . Anot her host ed blog syst em , t his one from Microsoft , is available at ht t p: / / spaces.live.com and called Windows Live Spaces. I f you already have a Hot m ail account or a Windows Live I D, you can use it here t o sign in. Spaces support s not j ust creat ing blog post s, but also adding phot o album s. Your blog URL will be ht t p: / / usernam e.spaces.live.com / blog/ , and depending on your t em plat e, appears as shown in Figure 10- 60 .

    A M icr osoft W in dow s Live Spa ce s sa m ple blog

    I nst ead of a blog—or in addit ion t o one—you m ay also want t o t ry out FriendFeed or Twit t er. Twit t er (ht t p: / / t wit t er.com ) , for inst ance, behaves a bit like a m ini blog. I nst ead of longer post s, you j ust t ell people what you're current ly doing. FriendFeed ( ht t p: / / friendfeed.com ) , st art ed by ex–Google em ployees, also let s you post t o a circle of befriended subscribers, and allows you t o sim ult aneously t rack what your friends are doing or reading. FriendFeed accom plishes t his by aggregat ing feeds from a variet y of sources, like Twit t er, blogs, YouTube, social news sit es ( including Digg.com and Reddit .com ) , and m ore, as shown in Figure 10- 61 . Think of it as t urning a person int o an RSS feed—very sim ple yet very addict ive!

    Fr ie n dFe e d le t s you follow t h e on lin e t r a ck s of in t e r e st in g pe ople

    N OTE

    I f blogging t ext doesn't do it for you, consider launching a podcast or video blog. Searching Google for " creat e podcast ," " vlog," and sim ilar can get you st art ed.

    H om e Pa ge Cr e a t or s GeoCit ies is one of t he oldest personal hom e page creat ors around. The ad- support ed version let s you st art for free, t oo. Get going at ht t p: / / geocit ies.com and sign in wit h your Yahoo! account ( first creat e an account if you don't have one) . Aft erwards, you can click Creat e a Web Sit e t o choose bet ween t wo t ools: Yahoo! PageBuilder and Yahoo! PageWizard. The PageWizard is even quicker t o use; aft er picking one of t he m any t em plat es, as shown in Figure 10- 62 , and com plet ing t he m ult i- st ep wizard, your page will appear on ht t p: / / geocit ies.com / username/ pagename.html. The layout varies depending on what you picked; a sam ple page is shown in Figure 10- 63 . Alt hough t he wizard is quick, t he ads and scrollbar t o t he right of t he result ing page m ay be t oo m uch for your t ast es.

    Th e Ge oCit ie s pa ge cr e a t ion w iza r d le t s you pick a t e m pla t e

    A Ge oCit ie s pa ge

    N OTE There are m any, m any m ore free web apps t o creat e a hom e page. Dom ain host ing services also oft en offer you an int egrat ed t ool when you sign- up wit h t hem . Querying Google.com for " hom e page m aker," " hom e page," " host ing," " get websit e," and so on will yield m ore alt ernat ives.

    Cr e a t in g a D iscu ssion Gr ou p I f you want t o m aint ain your own online discussion group, t he free phpBB ( ht t p: / / phpbb.com ) m ay be your t ool of choice. Alt hough it requires you t o have your own server host ed som ewhere, wit h support for t he PHP script ing language and a dat abase like MySQL, it also offers m uch m ore fine- t uning opt ions t han Google Groups. A sam ple of a " BB" ( Bullet in Board) in use can be seen in Figure 10- 64 .

    Th e ph pBB- pow e r e d for u m a t Ca na dia nPhot oClub.com

    Anot her paid alt ernat ive t o creat ing a discussion group is called vBullet in, available at ht t p: / / vbullet in.com .

    Drupal at ht t p: / / drupal.org, on t he ot her hand, is a full- feat ured, open source cont ent m anagem ent and com m unit y syst em , wit h a forum as j ust one of it s m any com ponent s.

    D I VE I N TO GOOGLE M APS, GOOGLE EARTH , AN D SKETCH UP 3 D I n old m a ps—dr a w n on pa pe r —illu st r a t ion s of dr a gon s w e r e u se d in a ll t h ose a r e a s t h a t w e r e ye t u n discove r e d. Th is visu a l discla im e r ca n be r ou gh ly t r a n sla t e d t o, " Look in g for t e r r it or y in for m a t ion in that spot ? W h y, n o on e w a n t s t o go t h e r e ; t h a t pla ce h ou se s da n ge r ou s be a st s!" Toda y, m ost of t h ose dr a gon s a r e gon e , a t le a st w h e n it com e s t o t h is lit t le pla n e t . An d w e don 't h a ve pr oble m s foldin g m a ps a n y m or e , e it h e r . . . a t le a st w h e n w e u se on lin e m a ppin g se r vice s lik e Google 's. Google M a ps Google Maps ( ht t p: / / m aps.google.com ) is a virt ual world m ap, as shown in Figure 11- 1. You can t ravel t o alm ost any spot on eart h, zoom in, and see what it 's like t here ( wit hout all t he ext ra expenses like flight t icket s) . Google com bines such t hings as locat ion nam es, sat ellit e or t errain info, panoram a phot os from st reet level wit h dat a such as user reviews for rest aurant s, direct ions, and—for t he Unit ed St at es—real- t im e t raffic inform at ion. The search box on t op is flexible enough so t hat you can search for bot h specific cit ies or count ries as well as nam es of businesses, rest aurant s, and m ore. Special layers—so- called KML ( Keyhole Markup Language) files—can be displayed on t op of Google Maps t o add t hird- part y inform at ion. Wit h a feat ure called My Maps, you can add your own m arkers, direct ions, or areas t o Google Maps, and edit your own t ext for t he m arker's info box. Google also allows you t o grab Google Maps as a program m able widget for your own blog or hom e page—t his is t he Google Maps API in act ion, which has spawned a great m any " m aps m ashups" online.

    Google M a ps. At t h e t op you ca n se e t h r e e bu t t on s: M a p, Sa t e llit e , a n d Te r r a in vie w . I n som e a r e a s, m or e bu t t on s a r e a va ila ble .

    N OTE Google Maps is also available for m obile phones. This includes direct ions, and, for som e cit ies in t he Unit ed St at es, t he display of real- t im e t raffic dat a t o help you avoid t raffic j am s. To download Google Maps for your phone or PDA, visit ht t p: / / google.com / gm m from your phone's web browser. I f your phone is support ed, you'll be able t o inst all it over t he air.

    Google Ea r t h Google Eart h ( ht t p: / / eart h.google.com ) , pict ured in Figure 11- 2, is t he deskt op sibling of Google Maps. Aft er launching it , you'll see t hat it s rot at ing 3D globe is a bit m ore fluid t han t he flat 2D view of Google Maps. Google Eart h in it s basic version is free, but t he paid version let s you generat e videos wit h effect s such as seam lessly zoom ing in t o a locat ion—t he kind of effect you'd see in TV news coverage. At t his t im e, Google Eart h has t he m ost com plet e support for Keyhole Markup Language inform at ion files—including support for anim at ions. Many organizat ions have dat a overlays t hat you can superim pose on t he globe by checking t he respect ive boxes of t he Layers pane. A Wikipedia layer adds locat ion- relevant inform at ion from t he online encyclopedia; t he Weat her layers allow you t o display clouds and forecast s; Nat ional Geographic m agazine provides a layer wit h regional inform at ion, including phot os, as well.

    La u n ch in g Google Ea r t h , soft w a r e for m e r ly k n ow n a s Ke yh ole Ea r t h Vie w e r

    Google Sk e t ch Up Google Sket chUp ( ht t p: / / sket chup.google.com ) is a 3D program for archit ect s draft ing t heir work, or hobby designers int erest ed in creat ing a 3D shape. Like Google Eart h, Sket chUp is not a web applicat ion, but inst ead requires you t o inst all an " offline" client , as pict ured in Figure 11- 3. The em phasis of Sket chUp is on ease of use; alt hough you m ay not be able t o do anyt hing and everyt hing wit h it , what you can do can oft en be done very quickly, wit h lit t le effort . And what ever 3D m odel you creat e in Sket chUp, you can t hen include in Google Earth. A great way t o st art learning about Sket chUp is t o follow t he online video t ut orials at ht t p: / / sket chup.google.com / t ut orials.ht m l. Once you've creat ed som et hing unique and int erest ing, you can upload it t o t he Google 3D Warehouse sit e, a direct ory of shared 3D m odels. You can also im port any m odel you find at t he 3D Warehouse int o your own creat ions.

    Th e Sk e t ch Up 3 D e dit or

    H a ck 1 1 5 . D r op a Google M a p On t o You r Sit e Take your Google m ap and run, freeing it from it s usual hom e at t he m aps.google.com dom ain. The easiest way t o em bed a Google m ap on your own sit e is available direct ly from ht t p: / / m aps.google.com . Just point t o any locat ion—you can also zoom in and swit ch t o sat ellit e view, for inst ance—and t hen click " Link t o t his page" on t op. A dialog will open t hat allows you t o copy an HTML port ion t o be past ed int o your own sit e, as shown in Figure 11- 4. You can also cust om ize t he m ap size by clicking t he " Cust om ize" link in t his dialog. The act ual code you end up wit h consist s of an inline fram e, am ong ot her t hings. An inline fram e is a window wit hin t he browser window t hat cont ains an ext ernal sit e's service; in t his case, Google Maps. An exam ple is shown in Figure 11- 5, and t he accom panying HTML code is in Figure 11- 6.

    N OTE I f you are concerned about using HTML t hat validat es, you need t o adj ust som e of Google's HTML at t ribut es, and also set your docum ent t ype t o " t ransit ional." To validat e your HTML, ent er your hom e page address int o t he official validat or provided by t he World Wide Web Consort ium at ht t p: / / validat or.w3.org. This can help alert you t o synt ax errors in your code. To learn m ore about HTML and CSS, visit ht t p: / / w3.org/ TR/ ht m l4/ and ht t p: / / w3.org/ TR/ CSS21/ respect ively.

    Th e Google M a ps e m be ddin g dia log

    I n clu din g t h e e m be d code in a sa m ple h om e pa ge

    Th e H TM L a n d Ca sca din g St yle sh e e t file s be h in d t h e sa m ple h om e pa ge

    H a ck in g t h e H a ck For m ore cont rol over what your m ap does and how it appears, you can use t he Google Maps API ( Applicat ion Program m ing I nt erface) . I n addit ion t o underst anding basic HTML, you'll need t o know som e JavaScript . To get st art ed wit h t he Google Maps API , head over t o ht t p: / / code.google.com / apis/ m aps/ and click on " Sign up for a Google Maps API key." Read and agree t o t he t erm s of service ( if you do agree) , ent er your hom e page address, and click Generat e API Key. Not only will you get your key now—don't forget t o m ake a copy of it for fut ure use—but Google also offers you som e sam ple m ap code t o begin wit h. Let 's analyze t he code, shown here:



    Google Maps JavaScript API Example





    This HTML will out put a blank page wit h not hing but a sm all m ap widget on it . I n t he head sect ion of t he HTML, you will see t hat t he Google Maps JavaScript library is referenced ( replace " YOUR- KEY" wit h your act ual key value) . The body includes a div elem ent . I n HTML, div is a generic divisor t o wrap j ust about anyt hing you can t hink of; in t his case, it wraps a m ap. The body elem ent also defines an onload event t hat involves t he funct ion load(), which runs aft er t he page finishes loading it s HTML and im ages. I n t he load() funct ion, you can see t hat t here's a sm all check t o confirm t hat t he browser is com pat ible wit h Google Maps widget s. I f t hat is t he case, a new m ap obj ect is creat ed—it looks for t he previously m ent ioned div elem ent wit h t he id " m ap" —and cent ered t o a specific lat it ude/ longit ude locat ion, wit h a specific zoom level. So far, t here's not hing in t his sam ple t hat an em bedding of a sim ple m ap inline fram e, as shown before, doesn't achieve as well. But once you underst and t his basic exam ple, you can add advanced feat ures by reading t hrough t he t ut orials, docum ent at ion and exam ples available at ht t p: / / code.google.com / apis/ m aps/ docum ent at ion/ . For inst ance, let 's say you want t o drop a m arker of your own on t he m ap. Below t he map.setCenter() com m and in t he previous exam ple, you can writ e t he following JavaScript t o do so: var point = new GLatLng(37.4313, -122.1229); map.addOverlay(new GMarker(point));

    Or perhaps you want t o add an info window when t he user clicks on t he m ap. A so- called event list ener can be defined for a result like t he one pict ured in Figure 11- 7: GEvent.addListener(map, "click", function() { map.openInfoWindow(map.getCenter(), document.createTextNode("Thanks for clicking!")); });

    Th e Google M a ps API in ( sa m ple ) a ct ion

    Because t hese program m able widget s can int eract wit h your own sit e's dat a in new ways, t hey are also called " m aps m ashups." One such m ashup let s you t rack t he locat ion of a package you are wait ing for [ Hack # 83] . Ot her m ashups allow you t o creat e a j ogging/ hike rout e, find ski resort s, m easure areas, look up zip codes, m ap your blog visit ors' locat ions, find out where t he sun is shining right now ( as shown in Figure 11- 8) , and m uch m ore. For a m ult it ude of m ashups like t hese, t ake a look at " 100 Things t o do wit h Google Maps Mashups" at ht t p: / / gm apsm ania.googlepages.com / 100t hingst odowit hgooglem apsm ashups. Also, anot her O'Reilly book, Google Maps Hacks ( by Rich Gibson and Schuyler Erle, 2006) , present s m any m ore ways t o ut ilize t he Google Maps API .

    Th e h t t p:/ / da yligh t m a p.com se r vice sh ow s t h e m ovin g da yligh t zon e s

    D I VE I N TO GOOGLE M APS, GOOGLE EARTH , AN D SKETCH UP 3 D I n old m a ps—dr a w n on pa pe r —illu st r a t ion s of dr a gon s w e r e u se d in a ll t h ose a r e a s t h a t w e r e ye t u n discove r e d. Th is visu a l discla im e r ca n be r ou gh ly t r a n sla t e d t o, " Look in g for t e r r it or y in for m a t ion in that spot ? W h y, n o on e w a n t s t o go t h e r e ; t h a t pla ce h ou se s da n ge r ou s be a st s!" Toda y, m ost of t h ose dr a gon s a r e gon e , a t le a st w h e n it com e s t o t h is lit t le pla n e t . An d w e don 't h a ve pr oble m s foldin g m a ps a n y m or e , e it h e r . . . a t le a st w h e n w e u se on lin e m a ppin g se r vice s lik e Google 's. Google M a ps Google Maps ( ht t p: / / m aps.google.com ) is a virt ual world m ap, as shown in Figure 11- 1. You can t ravel t o alm ost any spot on eart h, zoom in, and see what it 's like t here ( wit hout all t he ext ra expenses like flight t icket s) . Google com bines such t hings as locat ion nam es, sat ellit e or t errain info, panoram a phot os from st reet level wit h dat a such as user reviews for rest aurant s, direct ions, and—for t he Unit ed St at es—real- t im e t raffic inform at ion. The search box on t op is flexible enough so t hat you can search for bot h specific cit ies or count ries as well as nam es of businesses, rest aurant s, and m ore. Special layers—so- called KML ( Keyhole Markup Language) files—can be displayed on t op of Google Maps t o add t hird- part y inform at ion. Wit h a feat ure called My Maps, you can add your own m arkers, direct ions, or areas t o Google Maps, and edit your own t ext for t he m arker's info box. Google also allows you t o grab Google Maps as a program m able widget for your own blog or hom e page—t his is t he Google Maps API in act ion, which has spawned a great m any " m aps m ashups" online.

    Google M a ps. At t h e t op you ca n se e t h r e e bu t t on s: M a p, Sa t e llit e , a n d Te r r a in vie w . I n som e a r e a s, m or e bu t t on s a r e a va ila ble .

    N OTE Google Maps is also available for m obile phones. This includes direct ions, and, for som e cit ies in t he Unit ed St at es, t he display of real- t im e t raffic dat a t o help you avoid t raffic j am s. To download Google Maps for your phone or PDA, visit ht t p: / / google.com / gm m from your phone's web browser. I f your phone is support ed, you'll be able t o inst all it over t he air.

    Google Ea r t h Google Eart h ( ht t p: / / eart h.google.com ) , pict ured in Figure 11- 2, is t he deskt op sibling of Google Maps. Aft er launching it , you'll see t hat it s rot at ing 3D globe is a bit m ore fluid t han t he flat 2D view of Google Maps. Google Eart h in it s basic version is free, but t he paid version let s you generat e videos wit h effect s such as seam lessly zoom ing in t o a locat ion—t he kind of effect you'd see in TV news coverage. At t his t im e, Google Eart h has t he m ost com plet e support for Keyhole Markup Language inform at ion files—including support for anim at ions. Many organizat ions have dat a overlays t hat you can superim pose on t he globe by checking t he respect ive boxes of t he Layers pane. A Wikipedia layer adds locat ion- relevant inform at ion from t he online encyclopedia; t he Weat her layers allow you t o display clouds and forecast s; Nat ional Geographic m agazine provides a layer wit h regional inform at ion, including phot os, as well.

    La u n ch in g Google Ea r t h , soft w a r e for m e r ly k n ow n a s Ke yh ole Ea r t h Vie w e r

    Google Sk e t ch Up Google Sket chUp ( ht t p: / / sket chup.google.com ) is a 3D program for archit ect s draft ing t heir work, or hobby designers int erest ed in creat ing a 3D shape. Like Google Eart h, Sket chUp is not a web applicat ion, but inst ead requires you t o inst all an " offline" client , as pict ured in Figure 11- 3. The em phasis of Sket chUp is on ease of use; alt hough you m ay not be able t o do anyt hing and everyt hing wit h it , what you can do can oft en be done very quickly, wit h lit t le effort . And what ever 3D m odel you creat e in Sket chUp, you can t hen include in Google Earth. A great way t o st art learning about Sket chUp is t o follow t he online video t ut orials at ht t p: / / sket chup.google.com / t ut orials.ht m l. Once you've creat ed som et hing unique and int erest ing, you can upload it t o t he Google 3D Warehouse sit e, a direct ory of shared 3D m odels. You can also im port any m odel you find at t he 3D Warehouse int o your own creat ions.

    Th e Sk e t ch Up 3 D e dit or

    H a ck 1 1 5 . D r op a Google M a p On t o You r Sit e Take your Google m ap and run, freeing it from it s usual hom e at t he m aps.google.com dom ain. The easiest way t o em bed a Google m ap on your own sit e is available direct ly from ht t p: / / m aps.google.com . Just point t o any locat ion—you can also zoom in and swit ch t o sat ellit e view, for inst ance—and t hen click " Link t o t his page" on t op. A dialog will open t hat allows you t o copy an HTML port ion t o be past ed int o your own sit e, as shown in Figure 11- 4. You can also cust om ize t he m ap size by clicking t he " Cust om ize" link in t his dialog. The act ual code you end up wit h consist s of an inline fram e, am ong ot her t hings. An inline fram e is a window wit hin t he browser window t hat cont ains an ext ernal sit e's service; in t his case, Google Maps. An exam ple is shown in Figure 11- 5, and t he accom panying HTML code is in Figure 11- 6.

    N OTE I f you are concerned about using HTML t hat validat es, you need t o adj ust som e of Google's HTML at t ribut es, and also set your docum ent t ype t o " t ransit ional." To validat e your HTML, ent er your hom e page address int o t he official validat or provided by t he World Wide Web Consort ium at ht t p: / / validat or.w3.org. This can help alert you t o synt ax errors in your code. To learn m ore about HTML and CSS, visit ht t p: / / w3.org/ TR/ ht m l4/ and ht t p: / / w3.org/ TR/ CSS21/ respect ively.

    Th e Google M a ps e m be ddin g dia log

    I n clu din g t h e e m be d code in a sa m ple h om e pa ge

    Th e H TM L a n d Ca sca din g St yle sh e e t file s be h in d t h e sa m ple h om e pa ge

    H a ck in g t h e H a ck For m ore cont rol over what your m ap does and how it appears, you can use t he Google Maps API ( Applicat ion Program m ing I nt erface) . I n addit ion t o underst anding basic HTML, you'll need t o know som e JavaScript . To get st art ed wit h t he Google Maps API , head over t o ht t p: / / code.google.com / apis/ m aps/ and click on " Sign up for a Google Maps API key." Read and agree t o t he t erm s of service ( if you do agree) , ent er your hom e page address, and click Generat e API Key. Not only will you get your key now—don't forget t o m ake a copy of it for fut ure use—but Google also offers you som e sam ple m ap code t o begin wit h. Let 's analyze t he code, shown here:



    Google Maps JavaScript API Example





    This HTML will out put a blank page wit h not hing but a sm all m ap widget on it . I n t he head sect ion of t he HTML, you will see t hat t he Google Maps JavaScript library is referenced ( replace " YOUR- KEY" wit h your act ual key value) . The body includes a div elem ent . I n HTML, div is a generic divisor t o wrap j ust about anyt hing you can t hink of; in t his case, it wraps a m ap. The body elem ent also defines an onload event t hat involves t he funct ion load(), which runs aft er t he page finishes loading it s HTML and im ages. I n t he load() funct ion, you can see t hat t here's a sm all check t o confirm t hat t he browser is com pat ible wit h Google Maps widget s. I f t hat is t he case, a new m ap obj ect is creat ed—it looks for t he previously m ent ioned div elem ent wit h t he id " m ap" —and cent ered t o a specific lat it ude/ longit ude locat ion, wit h a specific zoom level. So far, t here's not hing in t his sam ple t hat an em bedding of a sim ple m ap inline fram e, as shown before, doesn't achieve as well. But once you underst and t his basic exam ple, you can add advanced feat ures by reading t hrough t he t ut orials, docum ent at ion and exam ples available at ht t p: / / code.google.com / apis/ m aps/ docum ent at ion/ . For inst ance, let 's say you want t o drop a m arker of your own on t he m ap. Below t he map.setCenter() com m and in t he previous exam ple, you can writ e t he following JavaScript t o do so: var point = new GLatLng(37.4313, -122.1229); map.addOverlay(new GMarker(point));

    Or perhaps you want t o add an info window when t he user clicks on t he m ap. A so- called event list ener can be defined for a result like t he one pict ured in Figure 11- 7: GEvent.addListener(map, "click", function() { map.openInfoWindow(map.getCenter(), document.createTextNode("Thanks for clicking!")); });

    Th e Google M a ps API in ( sa m ple ) a ct ion

    Because t hese program m able widget s can int eract wit h your own sit e's dat a in new ways, t hey are also called " m aps m ashups." One such m ashup let s you t rack t he locat ion of a package you are wait ing for [ Hack # 83] . Ot her m ashups allow you t o creat e a j ogging/ hike rout e, find ski resort s, m easure areas, look up zip codes, m ap your blog visit ors' locat ions, find out where t he sun is shining right now ( as shown in Figure 11- 8) , and m uch m ore. For a m ult it ude of m ashups like t hese, t ake a look at " 100 Things t o do wit h Google Maps Mashups" at ht t p: / / gm apsm ania.googlepages.com / 100t hingst odowit hgooglem apsm ashups. Also, anot her O'Reilly book, Google Maps Hacks ( by Rich Gibson and Schuyler Erle, 2006) , present s m any m ore ways t o ut ilize t he Google Maps API .

    Th e h t t p:/ / da yligh t m a p.com se r vice sh ow s t h e m ovin g da yligh t zon e s

    H a ck 1 1 6 . Add a Ga dge t t o Google M a ps Expand t he funct ionalit y of Google Maps t hrough m applet s. A " m applet " is what Google calls a gadget t hat can be added t o Google Maps. Mapplet s t ake t he opposit e approach from em bedding t he Google Maps API on your sit e [ Hack # 115 ] ; inst ead of put t ing a sm all Google Maps m ap on your sit e, you put a sm all part of your sit e or service ont o Google Maps. Users can t hen subscribe t o your m applet using Google Maps' My Maps t ab. To get a t ast e of m applet s, you can subscribe t o one yourself. Point your browser t o Google Maps (ht t p: / / m aps.google.com ) and swit ch t o t he My Maps t ab on t op. Under t he headline " Feat ured cont ent ," check t he box t it led Dist ance Measurem ent Tool. This t ool will now be act ivat ed and you can click any t wo point s on t he m ain m ap t o calculat e t he dist ance using kilom et ers or m iles, am ong ot her unit s, including such exot ic ones as " Babylonian t rade cubit " or " Am erican foot ball field." As pict ured in Figure 11- 9, I can see t hat I 'm roughly 3,992 m iles away from m y edit or Brian Jepson, who works wit h m e on t his book using Google Docs.

    Th e D ist a n ce M e a su r e m e n t Tool m a pple t

    You can find m ore m applet s by following t he " Browse t he direct ory" link on t op of t he My Maps t ab. Not e t hat wit hin t he direct ory, you can use t he Add by URL link next t o t he search box t o include m applet s which are not yet in t he direct ory. Cr e a t in g You r Ow n M a pple t How would you go about writ ing such a m applet service yourself? Mapplet s are a special form of Google Gadget s [ Hack # 60] t hat ut ilize t he Google Maps API [ Hack # 115 ] , so you need t o underst and a bit of bot h of t hese com ponent s. Google Gadget s are XML files st ored online, and are m ade up of HTML, st ylesheet definit ions, and JavaScript ; and in t he case of m applet s, t hat JavaScript m akes use of t he Google Maps API library.

    N OTE No m at t er where a m applet was originally st ored, Google will copy it t o t heir own dom ain, gm odules.com , before showing it t o t he user; t his caching will last for som e t im e and will keep t he load on your server low.

    To get an im pression of how t his all fit s t oget her, run t he Hello World sam ple m applet t hat Google provides. At Google Maps, click on My Maps, and t hen click t he " Browse t he direct ory" link. Swit ch t o t he sect ion Developer Tools on t he left , and add t he gadget called Mapplet Scrat ch Pad by clicking t he Add I t t o Maps but t on, as pict ured in Figure 11- 10 . Click Back t o Google Maps on t op, and you will now see t hat t he Mapplet Scrat ch Pad is enabled. Depending on your screen resolut ion, t he t ext area of t he scrat ch pad m ay be quit e sm all, so you m ay want t o copy t he code int o your own t ext edit or for m ore com fort able edit ing, t hen copy it back each t im e you want t o t est or save t he code. At t he foot er of t he scrat ch pad, you will find a link labeled Hello World ( you m ay need t o scroll down in t he scrat ch pad t o see it ) . Click it t o load t he sam ple code int o t he scrat ch pad, as shown in Figure 11- 11 . Click t he Preview but t on above t he code and you will see how t his code displays a green m arker wit h an info window reading " Hello World," as shown in Figure 11- 12 .

    Addin g t h e M a pple t Scr a t ch Pa d fr om t h e Google M a ps ga dge t dir e ct or y

    Th e M a pple t Scr a t ch Pa d con t a in in g t h e H e llo W or ld sa m ple ga dge t

    Pr e vie w in g t h e H e llo W or ld ga dge t

    Take a look at t he code behind t his m applet , writ t en by Google developer Thai: Code View:





    I f you've program m ed a Google Gadget before, part s of t his will look fam iliar t o you. There's t he XML declarat ion on t op, set t ing t he charact er encoding. The Module elem ent encloses everyt hing else. The ModulePrefs elem ent cont ains different at t ribut es indicat ing t he m applet t it le, t he aut hor nam e, and t he locat ion of t hum bnail im ages of t he m applet , am ong ot her inform at ion. I ncluded in t he ModulePrefs elem ent is t he elem ent nam ed Require, which references t he sharedmap library—t his is where t he m applet begins t o differ from gadget s included on iGoogle, Google's personalized hom epage service. Aft er t he m odule preferences com es t he m applet code wit hin t he Content elem ent as a m ixt ure of HTML and JavaScript . The script ed part s are explained in com m ent s from a Google developer: a m arker is dropped at t he cent er posit ion of t he m ap, an info window reading " Hello World" is at t ached t o t his m arker, and an event list ener will open t hat info window when you click anywhere on t he m ap. You can build on t his Hello World sam ple wit h your own JavaScript com m ands now, clicking Preview aft er each change. Google's m applet s developer guide, available at ht t p: / / code.google.com / apis/ m aps/ docum ent at ion/ m applet s/ guide.ht m l, goes int o m ore dept h wit h regard t o how you can program t his fram ework. You can also learn by viewing t he source from any gadget available in t he m applet direct ory; j ust click on it s linked nam e, and pick " View source."

    H a ck 1 1 7 . Cr e a t e You r Ow n Google M a ps La ye r Organize locat ion ( and t im e) on t op of Google's m aps service. You can add your own layer on t op of Google Maps, including rout es and m arkers, areas and info windows. You can share t his layer wit h ot hers and even collaborat ively edit t he layer wit h ot her users. Cr e a t in g t h e M a p To creat e your own m ap layer, go t o Google Maps ( ht t p: / / m aps.google.com ) and swit ch t o t he My Maps t ab on t op. Click t he " Creat e new m ap" link. You will now be asked t o nam e your m ap, add an opt ional descript ion, and choose bet ween a public and an unlist ed m ap.

    N OTE Unlist ed m aps are st ill publicly accessible, but only t o people who know t he full address—usually, t his m eans only people you shared t he m ap wit h will see it , but if one of t hese people has shared t he link wit hout your perm ission, it could be m any m ore people.

    For t his exam ple, I will creat e an overview of Barcam p conferences in Germ any. ( The concept of a Barcam p, a dynam ic " unconference" t ypically discussing t echnology and t he Web, originat ed in California and has spread t o m any ot her places since.) At t his t im e, t hese conferences don't have a single um brella organizat ion in Germ any, and t heir hom e pages are scat t ered all over t he place—by adding a m ap view, I can m ake t his m ore userfriendly. You will not ice t hat when you st art ed creat ing t he m ap, a set of t ools are added in t he t op left m ap corner: t he dragger t ool ( t he default ) , t he placem ark t ool, t he line t ool, and t he shape t ool. For m y conference m ap, I 'm picking t he placem ark t ool. I know t here was a conference in Berlin, so I am ent ering " berlin, germ any" ( wit hout t he quot es) int o t he search box on t op. You can also sim ply drag your way t o t he locat ion m anually. Once t he locat ion is in sight , I put t he placem ark on it wit h a single click. An info window pops up, allowing m e t o add t he inform at ion for t his place. I 'm swit ching t o t he rich t ext edit ing m ode, as shown in Figure 11- 13 , so t hat I 'm able t o add links and im ages as well. I will also creat e a new calendar in Google Calendar at ht t p: / / calendar.google.com , where I 'm adding t he dat es ( see Chapt er 7 ) , as shown in Figure 11- 14 . This way, I can cross- link t he inform at ion: t he calendar event s can link t o m y m ap, and t he m ap placem arks can link t o t he calendar.

    Google 's M y M a ps a llow s you t o a dd you r ow n pla ce m a r k s on t op of Google M a ps

    Cr e a t in g a Google Ca le n da r t o st or e e ve n t da t e s a ccom pa n yin g t h e cu st om m a p

    Now I will go about adding t he placem arks for t he ot her Germ an locat ions, like Cologne. I can copy and past e t he cont ent s of t he first info window's t ext box t o get st art ed wit h each new placem ark, and t hen j ust am end what is necessary. When finished, I click t he Done but t on t o t he left .

    N OTE Not sat isfied wit h t he default look of t he placem ark icon? While edit ing a placem ark, you can click t he icon in t he info window t o change it . This gives your m ap a m ore unique, recognizable feel. There is a

    variet y of default icons available from Google, and you can also add your own im age. For best result s wit h cust om graphics, keep t he icon size t o som et hing along t he lines of 30 x 40 pixels, and use a PNG file wit h half- t ransparent borders. Addit ionally, you m ight want t o give your icon a dist inct ive foreground and border color ( like blue wit h a black border) so t hat it 's highly visible on any background. You m ay also want t o give t he icon a point ed lower end so t hat it 's clear which locat ion it precisely point s t o. Take a look at Figure 11- 15 for an exam ple of how I convert ed t he Barcam p source logo t o a usable placem ark icon.

    Pr e pa r in g a good- look in g pla ce m a r k icon in you r im a ge e dit or of ch oice ( h e r e , Cor e l Ph ot oPa in t ) ; t h e or igin a l logo I pick e d is gr e e n on w h it e , so I 'll ch a n ge it t o blu e w it h a bla ck bor de r , sim ila r t o t h e de fa u lt Google pla ce m a r k color s.

    Sh a r in g You r M a p However, your placem arks will not be inst ant ly visible now t o everyone else using Google Maps; neit her will t he m ap inst ant ly appear in t he public m aps direct ory. So how do you invit e ot hers t o your m ap? Just click " Link t o t his page" on t op—m ake sure t hat your m ap is select ed t o t he left , t oo—and copy t he URL shown. You can share t hat address wit h anyone via em ail, in discussion groups, on your blog or hom e page, and so on. Som eone opening your link will t hen inst ant ly see your placem arks, direct ions and shapes, as shown in Figure 11- 16 , and also be offered t o click a Save t o My Maps link t o perm anent ly add t he m ap t o t heir My Maps t ab. And in case you added calendar but t ons t o your placem ark info windows, t he ot her person will have t he opt ion t o add t hat calendar t o t heir list of calendars by clicking t he calendar but t on.

    Vie w in g a cu st om m a p

    Allow in g Ot h e r s t o Edit t h e M a p Alon g W it h You You don't necessarily have t o edit a m ap all by yourself; m aybe ot her m em bers of a group or organizat ion have m ore inform at ion and are willing t o help. I f so, go int o t he edit ing m ode for your m ap once m ore by swit ching t o t he My Maps t ab on Google Maps, select ing your cust om m ap from t he list , and hit t ing t he Edit but t on. Now click t he link reading Collaborat e, and in t he dialog t hat opens up, as shown in Figure 11- 17 , ent er t he Gm ail em ail address of your friends or colleagues one by one, separat ed by com m as. I n t he advanced perm issions, you can choose t o allow your friends or colleagues t o invit e m ore collaborat ors. Alt ernat ively, if you want t o, you can even allow anyone t o edit t he m ap along wit h you.

    People collaborat ing wit h you on a m ap can do anyt hing you can do in t erm s of edit ing—t hat includes, for exam ple, delet ing all your placem arks, lines, and areas. However, unless you checked t he " Collaborat ors m ay invit e ot hers" box in your collaborat ion m anagem ent dialog, t hey will not be able t o invit e new collaborat ors.

    I n vit in g ot h e r s t o colla bor a t e w it h you on you r M y M a p

    H a ck 1 1 8 . En a ble Adva n ce d Sk e t ch Up Tools Expand your t oolbox. When using Sket chUp, you can display a variet y of t ool windows. For inst ance, you can enable t he Shadow Set t ings window by picking Window Shadows from t he m enu. You can also enable a larger t ool bar by select ing View Toolbar s Large t ool set ( on Mac, View Tool Palet t es Large t ool set ) . Preferences Anot her opt ion t o display m ore feat ures is available in t he preferences dialog. Choose Window Preferences) . Now swit ch t o t he Ext ensions t ab via t he left hand pane, as shown in Figure ( on Mac, Sket chUp 11- 18, and m ark Ut ilit ies Tools and Sandbox Tools. Press OK ( on t he Mac, close t he dialog box) and you will now have m ore opt ions, such as t he edit ing of organic t errain shapes. Figure 11- 19 shows Sket chUp wit h all t hese advanced t ools enabled.

    Th e Syst e m Pr e fe r e n ce s dia log

    Sk e t ch Up w it h a dva n ce d t ools e n a ble d

    H a ck 1 1 9 . Loa d Plu g- in s I n t o Sk e t ch Up Ext end t he nat ive Sket chUp funct ionalit y using Ruby script s. Google Sket chUp offers an API ( Applicat ion Program m ing I nt erface) in t he Ruby program m ing language. This way, you can add your own m enus t o Sket chUp, or download t hird- part y plug- ins t o ext end t he funct ionalit y of Sket chUp. To give t his a t ry, launch Sket chUp and pick Window Ruby Console from t he m enu. Many program m ing int roduct ions st art out wit h showing you how t o display t he words " Hello world! " , so here's how t o do it , Sket chUp st yle. Ent er t he following in t he Ruby console com m and line and press Ent er/ Ret urn: UI.messagebox("Hello world!")

    This displays a dialog t hat displays " Hello world! " . Click OK t o dism iss t he dialog. To get st art ed wit h m ore useful exam ples, you can delve int o t he Ruby language ( t he help file wit h m ore point ers can be found in t he m enu at Help Ruby Help) —or j ust download exist ing script s. You will find a couple of free script s at t he following URLs: Ruby Library Depot : ht t p: / / www.crai.archi.fr/ RubyLibraryDepot / Ruby/ em _arc_page.ht m Sm ust ard ( " The Com panion t o Sket chUp" ) : ht t p: / / sm ust ard.com / script s/ For inst ance, t he first sit e's Ruby script balustrade.rb ( by Tom asz Marek) creat es a balust rade wit h cust om dim ensions. Download t he script and drop it int o t he folder C: \ Program Files\ Google\ Google Sket chUp 6\ Plugins ( on Windows) or / Library/ Applicat ion Support / Google Sket chUp 6/ Sket chUp/ Plugins ( on Mac) . You can open t he file wit h any plain t ext edit or t o t ake a look at how t he balust rade feat ure is im plem ent ed. To run t he file, you first need t o load it int o Sket chUp by t yping load "balustrade.rb" int o t he Ruby console, and hit t ing Ent er/ Ret urn. I f t hings went right , t he console will out put "true" and you will now find t he new m enu ent ry Draw Balust rade. Click it and provide your desired set t ings in t he dialog, and a balust rade will be added t o your m odel, as shown in Figure 11- 20 .

    I n cert ain cont ext s, you m ay get som e harm less warnings from t he Ruby m odule when you load it . As long as you see a "true" result in t he Ruby console, it should work fine.

    Ot her script s provided on t he aforem ent ioned sit es include:

    Bom b ( Sm ust ard) : " Explodes all groups and com ponent s in t he m odel"

    Ca b ( Ruby Library Depot ) : " Creat es a cabinet "

    Ca m e r a Lin e s ( Sm ust ard) : " Creat es a group of lines t hat connect t he eye point s of all page cam eras"

    Com po_ Spr a y ( Ruby Library Depot ) : " Tool t o quickly populat e t he m odel wit h com ponent s ( t rees, people, rocks, grass . . . ) based on support shapes, opt ions, and const raint s"

    Cu t t in g_ W in dow s ( Ruby Library Depot ) : " Tool t o m ake t he windows/ doors aut om at ically cut doublesided walls"

    Gr ou pByTe x t u r e ( Sm ust ard) : " Groups faces by t ext ure for export t o ot her 3D soft ware"

    St r a yLin e s ( Sm ust ard) : " Label, Select , Delet e, or Show all t he open- ended line segm ent s in a drawing"

    Ru n n in g a t h ir d- pa r t y scr ipt in Sk e t ch Up

    H a ck 1 2 0 . Vie w t h e M oon a n d M or e on Google M a ps Zoom int o t he Moon, Mars, and ot her large chunks of m at t er float ing near our hom e planet . You've probably used Google Eart h or Google Maps t o get a bet t er pict ure of t his planet . Ot her planet s are m apped by Google t oo, t hough. Curious about t he surface of t he Moon, for inst ance? Just go t o ht t p: / / google.com / m oon/ and t ake a look, as pict ured in Figure 11- 21 . You will be able t o t oggle bet ween different views, and find special background inform at ion on t he landing of t he lunar m odule Eagle during t he Apollo m ission in 1969, when Neil Arm st rong st epped ont o t he Moon's surface. I n sim ilar vein, Google also has a special Google Maps- st yle service displaying planet Mars at ht t p: / / google.com / m ars/ , as pict ured in Figure 11- 22 . Also, t he deskt op program Google Eart h—which you can download for free at ht t p: / / eart h.google.com / download- eart h.ht m l—cont ains a special sky view. To see, it pick View Swit ch t o Sky from t he Google Eart h m enu, for a result as shown in Figure 11- 23 . Google Sky is also available as a web applicat ion at ht t p: / / sky.google.com . Google Sky is a powerful t ool for locat ing m ore t han j ust planet s and st ars: you can locat e deep- sky obj ect s such as nebulae and clust ers by searching for t heir cat alog num bers ( for exam ple, you can find t he spect acular Androm eda Galaxy by searching for NGC 224 or M31) . Google Sky also includes overlays from t he Hubble Telescope, Chandra X- Ray Observat ory, and m ore. For m ore inform at ion on locat ing and enj oying t hese obj ect s, see t he I llust rat ed Guide t o Ast ronom ical Wonders ( by Thom pson and Thom pson, O'Reilly, 2007) .

    Google M oon , sh ow in g in for m a t ion fr om t h e Apollo m oon la n din g

    Th e Google M a r s w e b sit e

    N OTE I f you're int erest ed in t he sky, not e t hat you can also swit ch t o a special background t hem e on Google displaying im agery of planet s. Go t o ht t p: / / igoogle.com and click " Select t hem e" t o t he right . Click on t he list it em Solar Syst em and hit t he Save but t on. Different planet s will now show on t he Google hom e page during different t im es.

    Google Sk y, a s pa r t of t h e Google Ea r t h pr ogr a m

    H a ck 1 2 1 . Cr e a t e Google M a ps Ove r la ys On t h e Fly A lit t le MySQL and Pyt hon put s your locat ions on t he m ap: you can generat e a KML file dynam ically wit h t he lat est and great est dat a. KML, t he Keyhole Markup Language, can be used t o describe locat ions in Google Eart h. I t 's an XML form at t hat Google Maps support s t oo. You can, for inst ance, past e t he URL of any KML file int o t he Google Maps search box and hit ret urn; seconds lat er, t he placem arks appear on t he m ap ( t he sam e is t rue for KMZ files, which are zipped KML files) . I f you've got geographical dat a is st ored in a dat abase such as MySQL, dropping it on Google Maps won't be a problem . I n t his hack, I 'm using Pyt hon t o t urn a dat abase t able int o a KML file. To im plem ent t his hack, you'll need:

    1 . Som e experience wit h Pyt hon and MySQL.

    2 . Your own MySQL server on which you can creat e t ables.

    3 . A recent version of Pyt hon, wit h t he MySQLdb and Minidom m odules inst alled ( if you don't have Minidom , go t o ht t p: / / pyxm l.sourceforge.net ) .

    Th e Ou t se t The dat abase t able, which is nam ed places, has t he following dat a definit ion. Feed t his int o MySQL, or whichever dat abase you are using, t o creat e it : CREATE TABLE placemarks (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), description VARCHAR(255), latitude DOUBLE, longitude DOUBLE);

    And you can fill it wit h dat a using t his com m and: INSERT INTO placemarks VALUES (NULL, "Restaurant Tao Tao", "Good Chinese food", 48.775855, 9.176846), (NULL, "Restaurant Sushi & Wok", "Good Thai food", 48.776039, 9.176491);

    I f you t hen issue t he com m and SELECT * FROM placemarks; you should see t he following: +----+------------------------+-------------------+-----------+-----------+ | id | name | description | latitude | longitude | +----+------------------------+-------------------+-----------+-----------+ | 1 | Restaurant Tao Tao | Good Chinese food | 48.775855 | 9.176846 | | 2 | Restaurant Sushi & Wok | Good Thai food | 48.776039 | 9.176491 | +----+------------------------+-------------------+-----------+-----------+

    Now, t he t rick is t o get t hat dat abase int o KML. The t arget KML t hat you need your Pyt hon code t o generat e is as follows:



    Restaurant Tao Tao Good Chinese food

    9.176846,48.775855,0

    Restaurant Sushi & Wok Good Thai food

    9.176491,48.776039,0



    ALL ABOUT PYTHON AND KML You can learn m ore about Pyt hon at ht t p: / / docs.pyt hon.org/ t ut / , and find out m ore about t he KML form at at ht t p: / / code.google.com / apis/ km l/ docum ent at ion/ km l_t ut .ht m l.

    Th e Pyt h on scr ipt St art off t he Pyt hon script by im port ing t he libraries for XML and MySQL handling: #!/usr/bin/python from xml.dom.minidom import Document import MySQLdb

    Now com es t he m ain funct ion: getKml, which accesses t he dat abase t o t urn it int o XML. Replace t he values YOUR_HOST, YOUR_USER_NAME, YOUR_PASSWORD, and YOUR_DATABASE wit h t he correct values for your dat abase: Code View: def getKml(): # First, the XML document is created, and a KML root element is appended to it doc = Document() kml = doc.createElement('kml') doc.appendChild(kml)

    Code View:

    kml.setAttribute('xmlns', 'http://earth.google.com/kml/2.2') document = doc.createElement('Document') kml.appendChild(document) # Now you can open the database conn = MySQLdb.connect(host = user = passwd = db =

    connection with your values 'YOUR_HOST', 'YOUR_USER_NAME', 'YOUR_PASSWORD', 'YOUR_DATABASE')

    cursor = conn.cursor(MySQLdb.cursors.DictCursor) # You are now selecting the appropriate values like the place's name and description, # to pass them to the addPlacemark function cursor.execute('SELECT name, description, latitude, longitude ' + 'FROM placemarks') rows = cursor.fetchall() for row in rows: addPlacemark(doc, document, row['name'], row['description'], row['latitude'], row['longitude']) cursor.close() conn.close() return doc.toprettyxml(indent = '

    ')

    The preceding list ing called an addPlacemark funct ion, which handles generat ing t he necessary XML t o show. This is t he code for it : Code View: def addPlacemark(doc, document, name, description, latitude, longitude): placemark = doc.createElement('Placemark') document.appendChild(placemark) nameElement = doc.createElement('name') placemark.appendChild(nameElement) nameElement.appendChild( doc.createTextNode(name) ) descriptionElement = doc.createElement('description') placemark.appendChild(descriptionElement) descriptionElement.appendChild( doc.createTextNode(description) ) point = doc.createElement('Point') placemark.appendChild(point) # Add the element to the element; coordinate values are longitude, # latitude and altitude in this order (though you can leave altitude at zero) coordinates = doc.createElement('coordinates') point.appendChild(coordinates) coordinatesText = str(longitude) + ',' + str(latitude) + ",0"

    coordinates.appendChild( doc.createTextNode(coordinatesText) )

    Finally, you j ust need t o out put t he KML t o t he browser: print 'Content-type: text/xml\n' print getKml()

    I f t he URL of your script is ( for exam ple) ht t p: / / exam ple.com / cgi- bin/ m ap.py , t hen you can now copy and past e t hat URL int o Google Maps. The result will be sim ilar t o t he one pict ured in Figure 11- 24 .

    Th e dyn a m ic KM L file displa ye d on Google M a ps

    H a ck 1 2 2 . Add a Sk y t o Google Ea r t h We know t he sky is blue, but it 's not always supposed t o be t hat blue. I f you creat e screenshot s based on Google Eart h views, like t he one showing New York in Figure 11- 25 , you will not ice som et hing is awkwardly absent : clouds. Grant ed, m ost of us prefer a clear sky t o a cloudy one, but a couple of clouds m ight give t he result ing view a m ore realist ic t ouch. Here's how t o add a sky t o Google Eart h. Provided t hat Google Eart h is already inst alled on your syst em , st art out by ent ering t he following in your browser's address bar: http://barnabu.co.uk/files/skydome/skydome-nl.kml

    When you are asked whet her t o open t his in Google Eart h or download it , choose t o open in it Google Eart h ( or, depending on your browser, you m ay also first need t o download it and t hen open t he download) . Once Google Eart h is launched and t he KML ( Keyhole Markup Language) file has finished loading, you will not ice a new list ent ry reading " Skydom e" in t he Places pane t o t he left . Check t he ent ry and all of it s list children. This will t rigger anot her download, which m ight t ake a few seconds. What is Google Eart h loading here? To explain, t he skydom e is act ually a t ext ured 3D m odel creat ed in Google Sket chUp, as shown in Figure 11- 26 . I t 's designed by Jam es St afford, who publishes m any m ore int erest ing Google Eart h m odels and hacks at his blog, ht t p: / / barnabu.co.uk . ( The cloud t ext ure originat ed wit h Philippe Hurbain from France, who has an int erest in panoram ic phot ography, showcased at ht t p: / / philohom e.com / panoram a.ht m .) Because of t his m odel's large dom e shape, which com plet ely " wraps" t he out look t owards t he horizon, it can serve as a background im age in Google Eart h.

    Th e sk y is blu e

    Now, zoom down ont o t he locat ion you want t o t arget . Not e t hat t he skydom e m ay not be im m ediat ely visible. To m ake it appear, t ry t o t ilt your current Google Eart h view t o t he side, or upwards and downwards. Once t he dom e t ext ure is correct ly aligned, t he sky will be shown behind ot her building m odels, as pict ured in Figure 1127. Or, m ore poet ically expressed in t he words of John Milt on, " Now glow'd t he firm am ent wit h living sapphires." And if you want t o replace t he sky t ext ure wit h anot her one, you can follow t he st eps out lined by Jam es at ht t p: / / barnabu.co.uk/ sket chup- skydom e/ .

    Th e dom e m ode l in Google 's Sk e t ch Up pr ogr a m

    N e w Yor k w it h t h e sk ydom e m ode l pr ope r ly loa de d a n d a lign e d

    EDI T SOMEONE ELSE'S LOCATI ON You can also edit t he locat ion of som eone else's business if you see t hat t hey're not displayed in t he precise correct spot ( and if t he business is not verified yet by t he owner) ; refer t o ht t p: / / m aps.google.com / support / bin/ answer.py?answer= 68474# m odify for m ore. Not e you cannot edit list ings t hat are already verified. Also, if you m ove t he m arker over 200 m et ers away from it s original locat ion, your change m ust be approved before it becom es act ive.

    H a ck 1 2 3 . Add You r Bu sin e ss t o Google M a ps You're already showing up in web search result s, but how do you get yourself int o Google Maps search result s? I f you have a business—a rest aurant , shop, or t he like—and you'd like it t o appear on Google Maps, you can add it yourself. You first need t o go t o t he Google Local Business Cent er at ht t p: / / google.com / local/ add/ lookup. As pict ured in Figure 11- 28 , you are required t o provide inform at ion like your address, phone num ber, and m ore. I n a lat er st ep, you can select t he cat egory and subcat egory of your business, opening hours, accept ed form s of paym ent , and also upload phot os. Once you've done t his, your list ing needs t o be verified by Google. You can choose t o receive your code via phone ( Google's syst em will call you and ask for a PI N t hat was handed out t o you) , via an SMS, or via a snail m ail t o t he address you provided.

    Addin g you r bu sin e ss a t t h e Google M a ps Loca l Bu sin e ss Ce n t e r

    H a ck 1 2 4 . M a k e You r 3 D M ode l M or e Sk e t ch - Lik e Som et im es com put er renderings can look t oo clean. You can add a m ore hum an t ouch using Sket chUp's St yles. The default rendering m ode of Sket chUp is already quit e refined, as t he m odel by E46LE from t he Google 3D Warehouse in Figure 11- 29 shows. But what if you want t o m ake your m odel look m ore sket chy, t rue t o t he nam e of t he program ? I f you have t he lat est version of Sket chUp inst alled, t his is easy. Just select Window St yles from t he m enu. A dialog opens t hat let s you apply different sket ch rendering m odes, like Sket chy Marker, Sket chy Pencil, or Sket chy Charcoal Loose—t his one is applied in Figure 11- 30 . To fine- t une t he rendering, you can now also swit ch t o t he Edit t ab of t he St yles dialog. You can increase t he lengt h of ext ensions drawn t o your line, for inst ance. Experim ent ing wit h t his feat ure can be fun and oft en shows im pressive result s.

    Th e de fa u lt r e n de r in g sh ow s color s a n d pr e cise lin e s

    M a k in g a se le ct ion fr om t h e St yle s dia log r e su lt s in sk e t ch y e dge s. ( Th is fe a t u r e w a s for m e r ly a va ila ble a s a plu g- in n a m e d St yle Bu ilde r .)

    Th e Google logo, r e n de r e d a s a sk e t ch

    You don't need t o rest rict yourself t o j ust archit ect ure m odels, eit her. As t he Google logo m odeled by Tyler shows in Figure 11- 31 , sket chy edges can look good on m any m odels. ( Not e t hat t his m odel, as well as t he 3D previous one, were downloaded from t he Google 3D Warehouse, which you can access by select ing File Get Models.) Warehouse

    H a ck 1 2 5 . Avoid t h e Cla sh of Con t e x t M e n u s Get t he best of bot h worlds by displaying Google Maps' cont ext m enu as well as your web browser's cont ext m enu—but only one at a t im e, as needed. By default , when you right - click a Google Maps area in popular browsers, you will see a cont ext m enu pop up, as shown in Figure 11- 32 . This cont ext m enu, showing ent ries like " Direct ions from here" or " Zoom in," is served by t he web app—Google.com —and not t he browser. The browser cont ext m enu is inst ead disabled by Google. However, som et im es you m ay want t o keep t he browser cont ext m enu. Not j ust in Google Maps, but also ot her Google applicat ions, like Google Docs. I n t hat case, your browser m ay allow you t o prevent web sit es from overriding t he browser's nat ive cont ext m enu. I n Firefox, for inst ance, t his is achieved by unchecking t he Opt ions Cont ent , t hen clicking t he Advanced but t on t o " Disable or replace cont ext m enus" box in Tools Preferences inst ead of t he right of " Enable JavaScript ," as shown in Figure 11- 33 . ( On t he Mac, click Firefox Tools Opt ions.)

    I n t h e Fir e fox a n d I n t e r n e t Ex plor e r de fa u lt se t t in gs, Google M a ps is a llow e d t o su ppr e ss t h e br ow se r con t e x t m e n u w h e n you r igh t - click t h e pa ge . Th is w a y, Google ca n displa y t h e ir cu st om con t e x t m e n u la ye r .

    Pr e ve n t in g scr ipt s fr om ove r r idin g you r con t e x t m e n u in Fir e fox

    Th e Fir e fox con t e x t m e n u h ide s t h e M a ps m e n u . W h a t if you do w a n t t h e M a ps m e n u e ve r y on ce in a w h ile , t h ou gh ?

    But what if you'd rat her have bot h cont ext m enus—som et im es one, som et im es t he ot her, depending on t he specific circum st ances and your t ask at hand? Take a look at Figure 11- 34 , which shows what happens when you configure Firefox t o disallow web sit es t o hide t he Firefox cont ext m enu, and t hen right - click Google Maps. I f you look closely, you will not ice t hat t he Maps cont ext m enu is st ill t here, albeit alm ost com plet ely hidden. So how can you force t he browser cont ext m enu t o show but st ill som et im es hide it t o see what 's behind? The answer: press Escape aft er right - clicking t he page. This will m ake t he browser cont ext m enu disappear, but st ill leave t he web app's cont ext m enu open.

    H a ck 1 2 6 . Plot Google Ca le n da r Eve n t s on a Google M a p I f you m aint ain a public event s list using Google Calendar, you can creat e a version of t he calendar's XML feed t hat will plot your event s on a Google Map or in Google Eart h. One way of get t ing a series of event s displayed on a Google Map is t o creat e a Google My Map [ Hack # 117 ] cont aining a separat e m arker for each event . This hack shows you t he ot her way: pulling t he event s int o t he m ap from Google Calendar. Using a Google Calendar t o declare t he event s t hat you want t o m ap has t he advant age t hat you can view event s by dat e, using a Google Calendar view, em bedded as a calendar or list view in your own web pages using Google Calendar em bedding code, or by locat ion, using t he Google Map.

    Google Ca le n da r pr ovide s a lin k t h r ou gh t o t h e e ve n t loca t ion plot t e d on a Google m a p

    Th e Google Ca le n da r opt ion s m e n u

    Ge ocodin g a Google Ca le n da r XM L Fe e d When you add an event t o a Google Calendar, you can opt ionally specify a locat ion for t hat event . Google Calendar will t hen t ry t o ident ify t he geographical posit ion of t hat locat ion so t hat you can view it on a Google Map by clicking on t he aut om at ically generat ed " m ap" link in t he event view for a calendar ent ry, as shown in Figure 11- 35 . I f you don't add a locat ion, t here is no m ap link provided—inst ead, you are present ed wit h a " Click t o add a locat ion" opt ion. A feed cont aining each calendar event as a separat e feed it em is available from each calendar. The feed form at is At om , used by t he Google Dat a API ( GDat a) fram ework. To find t he calendar's feed, first open t he pop- up opt ions m enu associat ed wit h one of your calendars—t here's a drop- down arrow by each calendar nam e—and select " Calendar set t ings," as shown in Figure 11- 36 . Toward t he bot t om of t he calendar set t ings are som e links t o various out put feeds from t he calendar ( Figure 1137) . The public and privat e feeds are bot h read- only feeds t hat can be accessed wit hout logging in t o Google Calendar. You have som e cont rol over t he cont ent of t he public feed via t he Calendar's sharing set t ings. The privat e feed is a full feed, and privat e only as long as you don't share t he URL wit h anyone else!

    Google Ca le n da r " Ca le n da r Se t t in gs" pa ge ; t h e fe e d URLs ca n be fou n d t ow a r ds t h e bot t om of t h e pa ge

    As we know t hat Google Calendar can generat e a m ap m arker from t he locat ion of an event , it would seem reasonable t o assum e t hat t his geocoded inform at ion would be m ade available in t he XML syndicat ion feed, essent ially defining it as a " GeoRSS" XML file ( RSS, like At om , is a feed form at ) . I f t hat were indeed t he case, t he GeoRSS feed URL could t hen be past ed direct ly int o a Google Maps search box, and aft er clicking t he Search but t on t he calendar event s associat ed wit h part icular locat ions would be plot t ed on t he Google Map, each wit h t heir own m ap m arker. Unfort unat ely, t he locat ion inform at ion is not ( current ly) included in t he calendar event s feed. Ent er Yahoo! Pipes, and in part icular it s Locat ion Ext ract or t ool. Pipes is a visual com posit ion t ool t o m ashup and convert various web feeds, and can be used for a variet y of hacks [ Hack # 135 ] . Creat ing a pipe is a very visual process—all it t akes is a m inut e or t wo t o creat e a Yahoo! pipe like t he one pict ured in Figure 11- 38 , which accept s t he Google Calendar GDat a XML URL, fet ches t he feed at t hat URL, and t hen uses t he Locat ion Ext ract or t o parse t he feed, adding longit ude and lat it ude dat a t o a feed it em if it is found t o cont ain a locat ion. To run a copy of t he pipe on your own Yahoo! Pipes account , feel free t o clone t he pipe from t he pipe's hom e page: ht t p: / / pipes.yahoo.com / ouseful/ geocal. I f you prefer creat ing t he pipe from scrat ch, t hen follow t hese st eps:

    1 . Creat e a new ( em pt y) pipe.

    2 . From t he User I nput s m enu, drag a URL I nput block ont o t he canvas ( a Pipe out put block will be aut om at ically added t o t he canvas, t oo) . The prom pt field should cont ain t he label for t he t ext box on t he " hom e page" for t he pipe. The nam e is t he nam e of t he variable in t he pipe's URL t hat will point t o t he calendar feed;

    3 . From t he Sources m enu, drag a Fet ch Feed block ont o t he canvas. Wire t he out put of t he URL input block t o t he landing point t o t he right of t he t ext box inside t he Fet ch feed block.

    4 . From t he Operat ors m enu, drag a Locat ion Ext ract or block ont o t he canvas. Wire t he out put of t he Fet ch Feed block t o t he input of t he Locat ion Ext ract or Block; wire t he out put of t he Locat ion Ext ract or block t o t he input of t he Pipe Out put block.

    A Ya h oo! Pipe t h a t ge ocode s a n RSS/ At om fe e d, give n it s URL. Th e loca t ion e x t r a ct or a ct u a lly look s a t t h e t it le a n d de scr ipt ion t a gs for possible loca t ion s.

    From t he " before" and " aft er" screenshot s of Figure 11- 39 and Figure 11- 40 , you can see how t he Locat ion Ext ract or has ident ified t he locat ion and added lat it ude and longit ude coordinat es t o t he feed.

    Th e Loca t ion Ex t r a ct or look s t o bot h t h e t it le a n d t h e de scr ipt ion e le m e n t s for possible loca t ion s. I n t h is ca se , a UK post code is con t a in e d in t h e de scr ipt ion , w h ich m e a n s t h a t t h e r e 's a good ch a n ce t h a t t h e Loca t ion Ex t r a ct or w ill be a ble t o ide n t ify t h e loca t ion .

    Aft e r t h e Loca t ion Ex t r a ct or block h a s w or k e d it s ge ocodin g m a gic. N ot e t h e a ppe a r a n ce of t h e y:loca t ion da t a .

    Running t he pipe act ually displays t he event s on a Yahoo! m ap, as displayed in Figure 11- 41 , but you can also get hold of a GeoRSS or KML feed URL t hat can t hen be used t o plot t he calendar event s on Google Maps, or in Google Eart h.

    Th e ge oca l Ya h oo! Pipe s in t e r fa ce ( ht t p:/ / pipe s.ya hoo.com / ouse ful/ ge oca l) . En t e r t h e URL of a n RSS/ At om fe e d su ch a s a Google Ca le n da r XM L fe e d a n d t h e pipe w ill ge ocode t h e fir st loca t ion it fin ds w it h in t h e t it le a n d de scr ipt ion e le m e n t s of e a ch fe e d it e m .

    I find it 's best t o use t he " Get as RSS" link, which provides a GeoRSS feed, for Google Maps, and t he " Get as KML" link t o use as a live Net work Link in Google Eart h [ Hack # 122 ] . When you add t he feed t o Google Maps or Google Eart h, each geocoded it em in t he calendar feed is list ed, along wit h a corresponding m arker on t he m ap, as shown in Figure 11- 42 .

    Google M a p plot t in g t h e RSS ou t pu t of t h e ge oca l Ya h oo pipe . Th e pipe 's KM L ou t pu t ca n be vie w e d in Google Ea r t h .

    This hack can be applied t o eit her public or privat e Google Calendar feeds. However, you t hen t rust bot h Yahoo! and Google not t o share t he URL of t hat privat e feed, which is privat e only because it 's hard t o guess. Vie w in g Pu blic Google Ca le n da r s in Google Ea r t h As well as viewing your own calendar event s on a Google Map, or in Google Eart h, you can also view event s from ot her public calendars list ed in Google Calendar. You can find public calendars by using t he Search Public Calendars but t on. Once you have found a public calendar you want t o display on a m ap, j ust run t hrough t he st eps list ed here:

    1 . Add t he public calendar t o your calendar.

    2 . Grab t he XML URL from t he Calendar Set t ings page.

    3 . Past e it int o t he geocal pipe ( ht t p: / / pipes.yahoo.com / ouseful/ geocal) and run t he pipe.

    4 . Grab t he " Get As KML" URL from t he Yahoo! Pipe " More Opt ions" m enu.

    5 . Use it as a Net work Link in Google Eart h.

    6 . View t he dat es in 3D geographical glory!

    I f you find t hat t he locat ion ext ract or is not working as expect ed, m odify t he locat ion of t he event . Unfort unat ely, you can't direct ly change any of t he det ails in som eone else's calendar, unless you m anage t o com e up wit h anot her hack t o deal wit h t hat event ualit y!

    N OTE You can also use Google Spreadsheet s as source file t o generat e rich- m edia placem arks for Google Eart h or Google Maps. Google explains t he process in a t ext and video t ut orial available at

    ht t p: / / eart h.google.com / out reach/ t ut orial_m apper.ht m l. Want t o plot Microsoft Out look event s on t he m ap, t oo? Try t he Windows applicat ion Google Calendar Sync, out lined at ht t p: / / www.google.com / support / calendar/ bin/ answer.py?answer= 89955.

    — Tony Hirst

    H a ck 1 2 7 . Tu r n Google Ea r t h I n t o a Fligh t Sim u la t or Google Eart h has an int erest ing feat ure allowing you t o t ry navigat ing an airplane. I f you have t he lat est version of Google Eart h inst alled, t hen you have m ore t han j ust a m aps program —you also have a flight sim ulat or. To j um p int o Google Eart h's flight sim ulat or, launch t he program and t hen press Ct rl+ Alt + A ( Windows) or Com m and+ Opt ion+ A ( Mac) . A dialog, pict ured in Figure 11- 43 , pops up and allows you t o choose bet ween a j et fight er ( F16) or a propeller plane ( SR22) . Hit t he St art Flight but t on, and t he flight sim ulat or window will fire up ( close it any t im e you want via t he " Exit flight sim ulat or" but t on at t he t op right , or by hit t ing Escape on t he keyboard) . The full cont rol opt ions for t he sim ulat or can be accessed by picking Help m enu. For inst ance:

    I ncrease t hrust : Page Up

    Reduce t hrust : Page Down

    Rudder left : Shift + left arrow

    Rudder right : Shift + right arrow

    Aileron left : Left arrow

    Aileron right : Right arrow

    Elevat or push: Up arrow

    Elevat or pull: Down arrow

    Th e fligh t sim u la t or dia log

    Keyboard Short cut s from t he

    Enj oy t he scenery during flight , as shown in Figure 11- 44 !

    Flyin g!

    N OTE For m ore Google Eart h goodies, also have a look at Frank Taylor's unofficial Google Eart h Blog at ht t p: / / geart hblog.com .

    H a ck 1 2 8 . Be yon d Google : Th e Ya h oo! M a ps W e b Se r vice , Live M a ps, a n d M or e Google Maps had quit e an effect on t he I nt ernet —not j ust on users, but also on com pet ing m apping product s, which aft er a while t ried t o im prove t heir service in t he direct ion of t he explorat ive, fast - paced int erface Google built . Ya h oo! Loca l Google Maps isn't t he only good web m apping applicat ion, by far. There's also Yahoo! Local Maps at ht t p: / / m aps.yahoo.com , am ong ot hers. Except for t he left hand side advert isem ent , t he int erface is rat her sim ilar t o Google Maps. A search box can t ake you st raight t o a locat ion—you can ent er " Rom e, I t aly" for inst ance—and you can drag or zoom t he m ap view. A click on t he Hybrid but t on on t op displays a m ix of st reet / cit y labels and sat ellit e im agery, as in Figure 11- 45 . Developers m ay be int erest ed in dabbling around wit h t he Yahoo! Maps web service. I t can be found at ht t p: / / developer.yahoo.com / m aps/ and offers not a single API but m any API s under one hood. You need t o sign up for an applicat ion I D as part of t he Yahoo! Developer Net work t o get st art ed. The Yahoo! Maps Sim ple API , for exam ple, allows you t o point t o a GeoRSS XML file cont aining your cust om m ap overlay inform at ion ( not e t hat Google Maps also support s GeoRSS, along wit h KML files) . The Map I m age API , on t he ot her hand, ret urns an XML file cont aining t he URL of an im age t hat you can direct ly include on your web page. Here's a sam ple URL and t he XML file it ret urns ( snipped and form at t ed) : ht t p: / / local.yahooapis.com / MapsService/ V1/ m apI m age?appid= YahooDem o&st reet = 701+ First + Avenue&cit y= Sunnyvale&st at e= CA

    http://gws.maps.yahoo.com/mapimage?MAPDATA=gc2rS...U-&mvt=m?cltype= onnetwork&.intl=us

    The result ing im age is shown in Figure 11- 46 .

    Ya h oo! Loca l sh ow s I t a ly's ca pit a l

    An im a ge r e t u r n e d via Ya h oo's M a p I m a ge API

    M a pQu e st AOL- owned MapQuest has been around longer t han m uch of t he com pet it ion. I t used t o look different from m odern m ap sit es, t oo, but now offers a new experim ent al layout at ht t p: / / bet a.m apquest .com t hat m ore closely resem bles Google Maps. As you can see in Figure 11- 47 , t here's a search box on t op, an explorat ion pane t o t he left , and a m ap in t he m iddle right . Dragging t he m ap relocat es t he view, and a click on t he Aerial I m age t ab t oggles from st reet t o sat ellit e m aps.

    M a pQu e st 's be t a sit e

    Ask M a ps Ask's m aps, available at ht t p: / / m aps.ask.com and shown in Figure 11- 48 , are organized in ways quit e sim ilar t o what Google provides. You can search on t op or pull down a recent locat ions box ( if you previously searched for som et hing, t hat is) . The m ap is m oved via drag and drop, and zoom ing can be done by t he use of t he left hand slider ( or, alt ernat ively, t he " + " and " - " keys on your keyboard, or your m ouse's scroll wheel) . You can also use your keyboard's arrow keys t o m ove about t he m ap. One int erest ing feat ure is Aut o- Drive, as Ask calls it . For inst ance, ent er " m ount ainview, ca t o san francisco, ca" , wit hout t he quot es, and hit Get Map or press Ret urn/ Ent er. You will now get bot h driving and walking direct ions ( use t he left hand t ab but t ons t o swit ch bet ween t he t wo) . Plus, you can now press t he green arrow below t he zoom bar t o " play" t he rout e, m eaning t he m arker will aut om agically m ove for you, wit h explanat ory speech bubbles popping up on t op ( like " Turn Left on Ocean View Blvd" ) .

    Ask M a ps

    M icr osoft Live Se a r ch M a ps Microsoft 's m aps service, locat ed at ht t p: / / m aps.live.com , is part of t he Live.com search engine init iat ive. As wit h t he ot her services, t he m ap as pict ured in Figure 11- 49 is zoom able ( wit h t he m ouse wheel, for inst ance) and draggable. However, not e t hat —st art ing cent ered on t he Unit ed St at es—you will hit an invisible wall when m oving west ward; t o m ove t he m ap t o China, for exam ple, m ake sure t hat you are dragging right ward t o t he east . Microsoft Live Maps also offers a feat ure rem iniscent of Google's placem arks. Called " pushpins," t hese can be found at Collect ions " Add a pushpin" at t he t op right web app m enu. A special gim m ick in Live Maps is t he " Bird's eye" but t on on t op. I n m ost locat ions, it will be " ghost ed" and can't be clicked. Zoom closer int o som e m aj or areas like New York or San Francisco, however, and it becom es clickable. Once clicked, it will offer a det ailed and vivid 3D perspect ive, as shown in Figure 11- 50 . The view is fixed t o be isom et ric, but can be rot at ed in st eps of 90 degrees using t he left hand rot at ion icons. To find a list of bird's- eye- enabled cit ies, point your browser t o ht t p: / / blogoscoped.com / googleappshacks/ link/ bird.

    M icr osoft Live Se a r ch M a ps

    M icr osoft 's bir d's- e ye vie w of N e w Yor k

    GOOGLE AN ALYTI CS AN D BEYON D : M ARKET YOUR SI TE, TRACK V I SI TORS Google An a lyt ics, for m e r ly ca lle d Ur ch in , is a w e b a pplica t ion t h a t t r a ck s you r sit e 's visit or s. All you n e e d t o do is in se r t a lit t le Ja va Scr ipt t r a ck e r in t o you r w e b pa ge s, a n d t h e n w a it for t h e da t a t o t r ick le in . Look in g a t n u m be r s a n d gr a ph s isn 't bor in g on ce you visu a lize t h e cr ow ds t h a t t h e se n u m be r s r e pr e se n t ; t h in k of it a s a vir t u a l pa t on t h e ba ck for you r h a r d w or k m a in t a in in g you r sit e . W h a t 's m or e , w it h t h is da t a in h a n d you ca n go ba ck t o you r sit e t o opt im ize it . Here is som e of t he feedback you get from t hese st at ist ics, wit h explanat ions of how t o act on it :

    A pa ge is ve r y popu la r . Think about why t hat m ight be t he case. Was your art icle especially wellwrit t en? Was your inform at ion hit t ing on a recent t rend? Were you offering a great product ? Knowing t he reason for t his m ight inspire som e changes on t he page, or give you ideas for new m at erial elsewhere on your sit e.

    A spe cific se a r ch qu e r y r e su lt s in a lot of pe ople fin din g you r sit e via Google . Take a look at t he keywords people ent er, and check out what page t hey land on when com ing from Google—and t hink about t he first im pression you're m aking on t hem . As t he saying goes, your visit ors spend 99% of t heir t im e on sit es ot her t han yours. Maybe it 's t im e t o em phasize a link, or add an int roduct ory blurb som ewhere on t he side.

    You r h om e pa ge got h e a vy t r a ffic ye st e r da y. Check t he referrer st at ist ics t o find out who linked t o you, and t rack t he source of t he t raffic t o find com m ent ary and feedback about your sit e. React t o t he feedback, if needed.

    You r h om e pa ge got h e a vy t r a ffic ye st e r da y, bu t you don 't se e a spik e fr om a n y spe cific r e fe r r in g sit e . Perhaps your hom e page address received a m ent ion in a radio or TV show!

    Pe ople spe n d m e r e se con ds on m ost pa ge s, bu t a fu ll m in u t e on on e ot h e r pa ge . Com pare t he pages in quest ion t o find out why t here's such a big t im e difference. Also, use your server log t o t race t he pat h t hey t ook t hrough your sit e, ret racing your visit ors' st eps.

    You r se r ve r w a s slu ggish on M on da y a n d you 'd lik e t o k n ow w h y. Check your st at s t o look for a peak. Maybe t here's a server script wit h subopt im al perform ance t hat needs rewrit ing?

    M a n y pe ople fillin g ou t you r or de r for m su dde n ly le a ve a t for m pa ge 2 ou t of 3 . Maybe t here's som et hing on page 2 t hey didn't expect , so check it out and fix it if needed.

    W h a t , t r a ffic is dr oppin g? Maybe it 's t im e t o t ake a break from checking st at s, and get t he word out again—by cont act ing webm ast ers, t alking t o readers or cust om ers, get t ing involved wit h t he com m unit y, or adding great cont ent t o your sit e.

    I n ot her words, all of t hese dat a point s are t ools equipping you t o do a good j ob, whet her you consider yourself a webm ast er, an e- m erchant , a news blogger, a web art ist , or anyt hing else or in- bet ween. On t he following

    pages, you will find hacks t hat could im prove your m ast ering of t his t ool—and t hus, your sit e. Addit ionally, t here are t ips and t ricks t hat can help you m arket your sit e. Ge t t in g St a r t e d w it h Google An a lyt ics To log in t o Google Analyt ics ( ht t p: / / www.google.com / analyt ics/ ) , you need a Google Account [ Hack # 1] .

    N OTE Analyt ics m akes heavy use of Flash, so if your com pany net work happens t o block cont ent for t he Flash plug- in, give your sysop a friendly nudge as a rem inder t hat Flash can be used for m ore t han j ust online gam es ( as a bonus, once your sysop is convinced, you will t hen be able t o play t hose online gam es, t oo) .

    Se t t in g u p a n e w sit e w it h Google An a lyt ics

    Aft er logging in, you can sign up for a new web sit e. Ent er your URL and provide an account nam e, as pict ured in Figure 12- 1. You will t hen be provided wit h a t racking code: a JavaScript snippet t hat you need t o add t o your sit e's HTML t em plat e. Copy and past e it as direct ed int o your syst em , and check back lat er t o verify t hat Google Analyt ics has det ect ed your t racking code. Once you've set up your sit e, you'll st art out on your dashboard, as pict ured in Figure 12- 2. The dashboard can be configured so t hat you will im m ediat ely see t hose elem ent s t hat are of m ost int erest t o you [ Hack # 129 ] . For inst ance, I configure m y sit e's st at ist ics so t hat I can im m ediat ely see t he t op cont ent by t it le, t he t op referring sit es ( t hat is, sit es t hat link t o t he sit e, a key source of visit ors) , and t he t op keywords used t o find t he sit e.

    Th e An a lyt ics da sh boa r d give s you a qu ick ove r vie w of you r st a t s

    H a ck 1 2 9 . Cu st om ize You r Google An a lyt ics D a sh boa r d Google Analyt ics has a couple of default boxes when you view a report for one of your web sit es. What if you aren't happy wit h t his select ion? At t he t im e of t his writ ing, t he Google Analyt ics dashboard displays a m ap overlay and a visit ors overview box, am ong ot hers. But what if you already have a good handle on where your visit ors com e from , m aking t he highlevel inform at ion cont ained on t he m ap overlay redundant ? Well, you can j ust change t he dashboard set t ings. One way t o do so is t o grab a box and drag and drop it elsewhere on t he page. You can also click t he X in t he upper- right corner of a box t o m ake t he elem ent disappear. I f you want t o add new boxes, inst ead, first navigat e t o t he Analyt ics page cont aining t he inform at ion you're int erest ed in, such as Cont ent Cont ent by Tit le. You can now click t he Add t o Dashboard but t on at t he t op of t he page ( Figure 12- 3) . Going back t o your dashboard, you will see t hat t he new box has been added, and you can rearrange it on t he page like ot her elem ent s.

    Click in g t h e Add t o D a sh boa r d bu t t on in An a lyt ics

    GOOGLE AN ALYTI CS AN D BEYON D : M ARKET YOUR SI TE, TRACK V I SI TORS Google An a lyt ics, for m e r ly ca lle d Ur ch in , is a w e b a pplica t ion t h a t t r a ck s you r sit e 's visit or s. All you n e e d t o do is in se r t a lit t le Ja va Scr ipt t r a ck e r in t o you r w e b pa ge s, a n d t h e n w a it for t h e da t a t o t r ick le in . Look in g a t n u m be r s a n d gr a ph s isn 't bor in g on ce you visu a lize t h e cr ow ds t h a t t h e se n u m be r s r e pr e se n t ; t h in k of it a s a vir t u a l pa t on t h e ba ck for you r h a r d w or k m a in t a in in g you r sit e . W h a t 's m or e , w it h t h is da t a in h a n d you ca n go ba ck t o you r sit e t o opt im ize it . Here is som e of t he feedback you get from t hese st at ist ics, wit h explanat ions of how t o act on it :

    A pa ge is ve r y popu la r . Think about why t hat m ight be t he case. Was your art icle especially wellwrit t en? Was your inform at ion hit t ing on a recent t rend? Were you offering a great product ? Knowing t he reason for t his m ight inspire som e changes on t he page, or give you ideas for new m at erial elsewhere on your sit e.

    A spe cific se a r ch qu e r y r e su lt s in a lot of pe ople fin din g you r sit e via Google . Take a look at t he keywords people ent er, and check out what page t hey land on when com ing from Google—and t hink about t he first im pression you're m aking on t hem . As t he saying goes, your visit ors spend 99% of t heir t im e on sit es ot her t han yours. Maybe it 's t im e t o em phasize a link, or add an int roduct ory blurb som ewhere on t he side.

    You r h om e pa ge got h e a vy t r a ffic ye st e r da y. Check t he referrer st at ist ics t o find out who linked t o you, and t rack t he source of t he t raffic t o find com m ent ary and feedback about your sit e. React t o t he feedback, if needed.

    You r h om e pa ge got h e a vy t r a ffic ye st e r da y, bu t you don 't se e a spik e fr om a n y spe cific r e fe r r in g sit e . Perhaps your hom e page address received a m ent ion in a radio or TV show!

    Pe ople spe n d m e r e se con ds on m ost pa ge s, bu t a fu ll m in u t e on on e ot h e r pa ge . Com pare t he pages in quest ion t o find out why t here's such a big t im e difference. Also, use your server log t o t race t he pat h t hey t ook t hrough your sit e, ret racing your visit ors' st eps.

    You r se r ve r w a s slu ggish on M on da y a n d you 'd lik e t o k n ow w h y. Check your st at s t o look for a peak. Maybe t here's a server script wit h subopt im al perform ance t hat needs rewrit ing?

    M a n y pe ople fillin g ou t you r or de r for m su dde n ly le a ve a t for m pa ge 2 ou t of 3 . Maybe t here's som et hing on page 2 t hey didn't expect , so check it out and fix it if needed.

    W h a t , t r a ffic is dr oppin g? Maybe it 's t im e t o t ake a break from checking st at s, and get t he word out again—by cont act ing webm ast ers, t alking t o readers or cust om ers, get t ing involved wit h t he com m unit y, or adding great cont ent t o your sit e.

    I n ot her words, all of t hese dat a point s are t ools equipping you t o do a good j ob, whet her you consider yourself a webm ast er, an e- m erchant , a news blogger, a web art ist , or anyt hing else or in- bet ween. On t he following

    pages, you will find hacks t hat could im prove your m ast ering of t his t ool—and t hus, your sit e. Addit ionally, t here are t ips and t ricks t hat can help you m arket your sit e. Ge t t in g St a r t e d w it h Google An a lyt ics To log in t o Google Analyt ics ( ht t p: / / www.google.com / analyt ics/ ) , you need a Google Account [ Hack # 1] .

    N OTE Analyt ics m akes heavy use of Flash, so if your com pany net work happens t o block cont ent for t he Flash plug- in, give your sysop a friendly nudge as a rem inder t hat Flash can be used for m ore t han j ust online gam es ( as a bonus, once your sysop is convinced, you will t hen be able t o play t hose online gam es, t oo) .

    Se t t in g u p a n e w sit e w it h Google An a lyt ics

    Aft er logging in, you can sign up for a new web sit e. Ent er your URL and provide an account nam e, as pict ured in Figure 12- 1. You will t hen be provided wit h a t racking code: a JavaScript snippet t hat you need t o add t o your sit e's HTML t em plat e. Copy and past e it as direct ed int o your syst em , and check back lat er t o verify t hat Google Analyt ics has det ect ed your t racking code. Once you've set up your sit e, you'll st art out on your dashboard, as pict ured in Figure 12- 2. The dashboard can be configured so t hat you will im m ediat ely see t hose elem ent s t hat are of m ost int erest t o you [ Hack # 129 ] . For inst ance, I configure m y sit e's st at ist ics so t hat I can im m ediat ely see t he t op cont ent by t it le, t he t op referring sit es ( t hat is, sit es t hat link t o t he sit e, a key source of visit ors) , and t he t op keywords used t o find t he sit e.

    Th e An a lyt ics da sh boa r d give s you a qu ick ove r vie w of you r st a t s

    H a ck 1 2 9 . Cu st om ize You r Google An a lyt ics D a sh boa r d Google Analyt ics has a couple of default boxes when you view a report for one of your web sit es. What if you aren't happy wit h t his select ion? At t he t im e of t his writ ing, t he Google Analyt ics dashboard displays a m ap overlay and a visit ors overview box, am ong ot hers. But what if you already have a good handle on where your visit ors com e from , m aking t he highlevel inform at ion cont ained on t he m ap overlay redundant ? Well, you can j ust change t he dashboard set t ings. One way t o do so is t o grab a box and drag and drop it elsewhere on t he page. You can also click t he X in t he upper- right corner of a box t o m ake t he elem ent disappear. I f you want t o add new boxes, inst ead, first navigat e t o t he Analyt ics page cont aining t he inform at ion you're int erest ed in, such as Cont ent Cont ent by Tit le. You can now click t he Add t o Dashboard but t on at t he t op of t he page ( Figure 12- 3) . Going back t o your dashboard, you will see t hat t he new box has been added, and you can rearrange it on t he page like ot her elem ent s.

    Click in g t h e Add t o D a sh boa r d bu t t on in An a lyt ics

    H a ck 1 3 0 . Opt im ize You r Sit e for Se a r ch En gin e s This sect ion is a bit of a nonhack, act ually. Hacks are supposed t o be quick and clever ways of doing t hings—t he kind of t rick t hat , once known, creat es a short cut t o a desired out com e. And t hat 's t he t hing wit h search engine opt im izat ion ( SEO) , t he art of t rying t o rank t he pages of your web sit e well in Google and ot her engines for a variet y of search queries. I f SEO were an effort less craft , t hen m illions of us could easily apply it —but t here are st ill only around 10 pages in every search result ! This m eans t here will always be com pet it ion for t his scarce resource. I n addit ion t o t hat , Google and ot hers work hard t rying t o prevent any " short cut " t o a precious # 1 ranking, unless t he sit e is really good and wort hy of t hat ranking. So in realit y, t he best SEO t ip is t his: have a sit e t hat 's good. Off- Pa ge Opt im iza t ion Offering t errific product s, cont ent , or services on your sit e is a way t o m ake it rank well—because t hen your sit e will at t ract backlinks. And backlinks are at t he heart of t he ranking algorit hm of m ost search engines t oday. A backlink happens when som eone sees your sit e and likes it , and t hen links from t heir sit e t o yours; t his sends you visit ors as well as " link love." Google and ot hers, upon finding t he link, will check out t he aut horit y of t he linking sit e, which t hen adds t o t he aut horit y of your sit e.

    People in t he past t ried t he short cut of creat ing m any sit es j ust for t he purpose of linking t o t heir prim ary web sit e; t his is called a linkfarm . Anot her short cut , which is cost ly, is using paid links. However, m ost of t hese approaches can backfire, in t he sense t hat your sit e get s banned com plet ely from search engines. The webm ast er guidelines of Google can be wrapped up as follows: opt im ize your sit e for your visit ors, not for search engines.

    When Google looks at backlinks, t hey don't j ust increase t he aut horit y ranking of your sit e; t hey also associat e t he keywords of t he link wit h your page. I f lot s of blogs link t o your sit e using t he words " happy" and " cam per" and variat ions t hereof, it m ay well be t hat ( once t im e passes) , you'll find yourself on t op of t he search result s for " happy cam per." Grant ed, even if you have great cont ent on your sit e, som et im es ot her webm ast ers, bloggers, online j ournalist s, or online com m unit ies m ay sim ply not know about t hat cont ent . I n t hat case, it m akes sense t o get t he word out by get t ing involved in ot her com m unit ies, sending out relevant t ips t o webm ast ers, or cont act ing bloggers. Always t hink about how your cont ent , product or service can help t hem , t hough, by sending out only relevant point ers t hat you im agine t hey'll be glad t o receive. To know whet her t hey'll likely be glad t o receive your point er also consist s of knowing t hem ; inst ead of sending out point ers in bulk ( which you should never do) , t his m eans t hat you need t o respect fully t ake t he t im e t o first get t o know a person or com m unit y you want t o cont act . There's a popular saying in Germ any for t his—" as you shout int o t he woods, so t he echo ret urns." On - Pa ge Opt im iza t ion Once you've underst ood t he m ost im port ant part of t he equat ion, t he off- page opt im izat ion, you can fine- t une t he on- page opt im izat ion—m eaning everyt hing t hat t akes place on your sit e ( like your HTML t em plat e, your t it les) , not on ot her people's sit es ( like backlinks) : Ca t e r for t h e " lon g t a il" of k e yw or ds by offe r in g lot s of va r ie d con t e n t . Maybe t here are only 10 result s

    on each search result page, but t here are m illions of such t op 10 list s—because people look for m illions of different t hings, using m illions of different search queries. One way of cat ering for t he long t ail of keywords is t o ensure t hat each of your pages has a unique t it le ( and, ideally, rat her unique cont ent as well) . Anot her is t o add t ranslat ions of your pages for a m ult it ude of languages, which will generat e a m ult it ude of new ways t o find you ( t here are paid online services t o which you can subm it a t ext file, and t hen pick t he languages you want it t o be t ranslat ed int o by nat ive speakers) . M a k e you r se r ve r r e spon sive , a n d u se cle a n a n d st r u ct u r e d H TM L. The best cont ent won't fare well on an unst able t echnical base, so m ake it t he m ost st able you can. One way t o check your sit e for errors is t o validat e it using t he World Wide Web Consort ium 's HTML validat or at ht t p: / / validat or.w3.org. You can find out m ore about HTML and XHTML at ht t p: / / w3.org/ TR/ ht m l401/ and ht t p: / / w3.org/ TR/ xht m l1/ , respect ively. Add on ly con t e n t t o you r pa ge s t h a t be n e fit s you r visit or s. You don't need t o ( in fact , shouldn't ) add overlong, keyword- st uffed t it les, or hidden keywords, or anyt hing else m erely t arget ed at search engines. One t hing you can do, t hough, is add descript ive t ext som ewhere on a page, like in t he foot er, t hat gives a good overview of what t he sit e is about ; t his t ext will alm ost aut om at ically include a wide range of relat ed keywords people m ay look for. Tr e a t e a ch of you r pa ge s a s " m icr ocon t e n t ." Microcont ent m eans cont ent t hat can be underst ood wit hout knowing furt her cont ext about your sit e. The page should be able t o " st and on it s own." Am ong ot her t hings, it m eans t hat a page has a clear concise t it le, a beginner- friendly int roduct ory sent ence, and a readable and perm anent URL. Suppose t hat t he page in quest ion list s favorit e Albert Einst ein quot es. Well, t hen it s t it le should be " Albert Einst ein quot es" or sim ilar; it s first heading should be som et hing like " Quot es by Albert Einst ein" ; and t here m ight be an int roduct ory sent ence along t he lines of " The following quips by Einst ein are not ewort hy bot h for being prescient , as well as funny." The URL of t he page m ay be ht t p: / / yourfavorit equot es.exam ple.com / einst ein. Furt herm ore, below t he Einst ein quot es t here could be links t o quot es by ot her fam ous scient ist s, a link t o a biography of Einst ein, and a link t o an Einst ein discussion board ( whet her it 's on anot her sit e or yours) . There m ay also be a phot o of young, fuzzy- haired Albert som ewhere on t he page. I n a nut shell, if you would ask yourself t he quest ion, " Which is t he best single and self- cont ained page on t he Web for som eone looking for Albert Einst ein quot es?" , t he answer should be a resounding " Why, t his one of course! " Cr e a t e a good, sim ple n a viga t ion st r u ct u r e for you r sit e . Every page you want visit ors t o find indexed in Google should be linked from som ewhere ( and not wit hin part s of your sit e t hat would require Flash, or JavaScript , or fram es, eit her) . Keep your sit e's navigat ion st ruct ure sim ple and all- encom passing. I f you consider a part icular page t o be of im port ance, t hen don't m ake t he navigat ion pat h t o it overly long, but link t o it st raight from your hom e page. On t he ot her hand, also don't oversim plify t he hierarchy of pages—because linking t o 10,000 of your sit e's pages from t he front page will great ly devalue each individual link. I f you r sit e 's t opic is oft e n r a t h e r dr y, con side r a ddin g a cr e a t ive vide o, fu n ga m e , or in t e r e st in g a r t icle som e w h e r e . Even if you have t he best cont ent or service in your field, som et im es it t akes a lit t le ext ra t o get t he word out . Ope n u p you r sit e a n d give fr e e ly. Consider allowing people t o run wit h your cont ent by m aking it Creat ive Com m ons- licensed ( see ht t p: / / creat ivecom m ons.org) , by offering gadget s [ Hack # 60] or a developer API ( applicat ion program m ing int erface) , or by t urning it int o em beddable cont ent via sit es like YouTube. Be m ore wat er t han ship. M a k e you r sit e a cce ssible . Accessibilit y is a broad t opic t hat covers adj ust ing your sit e t o work wit h different devices ( like m obile phones, print ers, t ext - t o- speech engines) as well as different browser set t ings ( like wit h JavaScript or im ages disabled) or browsing use- cases ( like right - clicking a link t o open it in a new window, or using t he back but t on) . I ndeed, t ry browsing your sit e wit h im ages and JavaScript t urned off. How usable is it ? ( And as your browser m ay not allow you t o disable cert ain feat ures, you can also use a t ext browser like Lynx: ht t p: / / lynx.browser.org.) Many t hings can be done t o im prove your sit e's accessibilit y: use appropriat e alt t ext for im ages where needed, replace fram es wit h a server- side t em plat e t hat em ulat es fram e behavior, or ensure t here are no

    JavaScript - based redirect s t hat break t he back but t on. Replacing a feat ure t hat requires a rare plug- in wit h one im plem ent ed in st andardized web t echnologies can m ake sense as well. For a full accessibilit y checklist , t ake at look at ht t p: / / w3.org/ TR/ WaI - WEBCONTENT/ Once you consider t hese issues, you can t rack t he out com e of your work by checking t he Google result s of keywords relevant t o your sit e, and by checking your st at s via Google Analyt ics or ot her program s. At t his point , don't worry t oo m uch about ranking det ails, t hough, or expect super- fast result s. Also, don't spend hours looking at Google Analyt ics wondering why t he num bers aren't higher yet —rat her, im prove your sit e and get t he word out . Or, t o put it int o words com m only at t ribut ed t o Albert Einst ein: " Not everyt hing t hat count s can be count ed, and not everyt hing t hat can be count ed count s."

    H a ck 1 3 1 . Tr a ck t h e Tr a ffic of You r iGoogle Ga dge t s Get valuable usage st at ist ics for your Google gadget , wit hout paying t oo m uch at t ent ion t o page views. When you build an iGoogle gadget [ Hack # 60] you probably want t o know m ore about how people use it . Next t o get t ing direct user feedback via em ail, t racking your gadget st at ist ics is t he best feedback. Before underst anding how you can t rack your gadget t raffic, you need t o underst and what exact ly t o t rack. On norm al web pages, one of t he m ost popular values t o t rack is t he page view. However, t his num ber is less useful for iGoogle gadget s. That 's because your gadget m ay be included am ong a dozen ot her gadget s, t riggering a page view whenever t he user visit s iGoogle—even when your gadget is ignored, and t he user is j ust perform ing a web search. More useful t han t he page view m ay be t he act ual num ber of gadget users as well as t he am ount of int eract ions wit h your gadget . To find t he num ber of users who subscribed t o your gadget , j ust go t o your gadget 's det ail page in t he iGoogle direct ory. You can find it by opening t he m enu from t he t op right of your gadget box, and t hen select ing " About t his gadget ." I f your gadget URL is ht t p: / / exam ple.com / gadget .xm l, t hen t he det ail page would be: http://google.com/ig/directory?url=example.com/gadget.xml

    ( I f you can't find your gadget in t he direct ory yet , subm it it at ht t p: / / google.com / ig/ subm it and wait one or t wo weeks.) On t his page, you will now find a t ext like " 243 users" , as pict ured in Figure 12- 4. Com pare t his t o sim ilar gadget s' num bers t o get a feeling of how well your gadget is doing.

    Th e n u m be r of u se r s is sh ow n on a ga dge t 's de t a il pa ge ( 3 ,9 9 3 in t h is ca se )

    How t o best get t he num ber of int eract ions wit h your gadget depends on t he t ype of gadget and how you st ore t he gadget XML code. For inst ance, if t he gadget in quest ion is a gam e st ored on your own server, t hen you could include an int roduct ory splash screen wit h a St art but t on in t he m odule code. The int ro screen would be host ed by Google—as it s HTML is cont ained right in t he m odule code—but you'd set up t he gadget so t hat clicking t he St art but t on would request a page from your server. This way, you can use your norm al Google Analyt ics t racking code ( see t he int roduct ion t o t his chapt er) , or any ot her t racking m echanism you already use on your server, and sim ply count t he page views of t he gam e's page. Here is a sam ple m odule, where exam ple.com would be your dom ain:



    Find anagrams with Anagramania!

    Start



    I f on t he ot her hand you host all m odule cont ent wit hin t he m odule code it self, you can m ake use of a special Google Analyt ics library available for gadget s. You can t hen m ake a call t o t rack page views, or t o t rack specific event s in your m odule, like clicks ( please not e t hat som e at t ribut es necessary t o subm it your gadget t o t he direct ory, like t he aut hor em ail, have been om it t ed from t his exam ple; see [ Hack # 60] for a m ore com plet e exam ple) :





    Clicks on this div will be tracked

    ]]>

    Not e t he t hree bold part s of t his XML gadget code. First , t he Require elem ent prepares t he gadget for Google Analyt ics t racking. Second, a script elem ent em beds a call t o an Analyt ics funct ion t o regist er t he page view; t he value /mygadget is a st ring t hat you can define yourself t hat will be shown as a pat h in Google Analyt ics report s. Third, t he onclick event of t he divisor elem ent near t he end of t he m odule regist ers when people click t he div. ( You can t rack ot her event s t hat are fired, t oo—not j ust clicks.)

    N OTE The values reading YOUR_ANALYTICS_ID in t he m odule code shown in t his hack need t o be replaced by your act ual Analyt ics ident ifier. To obt ain t his I D, log in t o Google Analyt ics. Next t o your sit e's nam e in t he Analyt ics overview, click Edit . Now click Check St at us in t he t op right . Your t racking ident ifier will be displayed in a snippet box for easy copy and past ing. I t has t he form of UA- 12345- 6. Give Google Analyt ics som e t im e t o st art showing t racking num bers. The st at s do not appear im m ediat ely aft er you set up t he t racking.

    H a ck 1 3 2 . Cr e a t e a Fir e fox Ke yw or d t o Sk ip t h e An a lyt ics Login Box Save som e seconds ( and keyst rokes) if you frequent ly check your st at s. Current ly, when you go t o ht t p: / / analyt ics.google.com , you will be forced t o click t he Sign I n but t on every t im e, even when you are already signed in. There are different ways t o avoid t his t o j um p st raight t o your report s overview ( or, if you prefer, st raight t o a single sit e's report s) . I n Firefox, you can add a bookm ark keyword. First , log in t o Analyt ics. Now bookm ark t he page. Right - click t he bookm ark you've creat ed and select Propert ies from t he cont ext m enu t hat appears. I n t he propert ies dialog box, ent er t hey keyword " st at s" ( or any ot her word you can easily rem em ber) . Click t he OK but t on. Next t im e you want t o see your st at ist ics, you can j ust ent er " st at s" in t he browser address bar; as long as you were logged in before, you don't need t o reent er your login inform at ion t his t im e. You can also use t hese bookm ark keywords t o j um p specifically t o a single sit e's report , as shown in Figure 125 . Just bookm ark t he page in quest ion, and in t he bookm ark propert ies, use a keyword like " m ysit e st at s" ( where " m ysit e" is t he nam e of your sit e) .

    Addin g a k e yw or d for a book m a r k

    H a ck 1 3 3 . Ex por t You r An a lyt ics Tr a ffic t o Google Spr e a dsh e e t s Export your t raffic dat a, visualize it , and share it in ways t hat are not possible wit hin Google Analyt ics. Google Spreadsheet s ( see Chapt er 3 ) accept s Com m a- Separat ed Values dat a, and Google Analyt ics export s such CSV dat a—which m eans t hat you can m ove your sit e st at ist ics int o Spreadsheet s. Ex por t in g t h e D a t a First , go t o Google Analyt ics and find a fit t ing report t hat you'd like t o export . I n t his hack, I 'm picking Traffic Referring Sit es from t he navigat ion m enu. Click t he Export but t on in t he t op, as shown in Figure 12Sources 6 , and click CSV. ( There's an Excel icon next t o t he link, as CSV can also be opened wit h Microsoft Excel.) Save t he CSV file on your disk. Opening t he CSV file wit h a plain t ext edit or, you will see a port ion sim ilar t o t he following: Code View: # ---------------------------------------# Table # ---------------------------------------Source,Visits,Pages/Visit,Avg. Time on Site,% New Visits,Bounce Rate,Visits,G1, Goal Conversion Rate,Per Visit Goal Value blogoscoped.com,2056,3.2660505836575875, ... generatorblog.blogspot.com,154,7.428571428571429, ... stumbleupon.com,114,1.956140350877193, ... ...

    N OTE I f you've got a spreadsheet program such as Microsoft Excel inst alled on your com put er, CSV files will probably open wit hin it aut om at ically. To open it in your preferred t ext edit or, launch t he t ext edit or first , t hen use e.g. File Open t o open t he CSV file.

    For t he purpose of opening it wit h Spreadsheet s, I 've decided t o delet e ot her dat a in t he CSV file ( as t he general num ber of visit ors for t he t im e period was included as well) and save it again.

    Ex por t in g CSV da t a fr om Google An a lyt ics r e por t s

    I m por t in g t h e D a t a Now open Google Docs ( ht t p: / / docs.google.com ) and click Upload in t he t op bar. Browse for your Analyt ics CSV file and click Upload File, as pict ured in Figure 12- 7. ( Google not es t hat t he m axim um file size is 1MB.)

    Uploa din g you r CSV file t o Google D ocs

    Aft er a while, a Spreadsheet s docum ent will open. I 've m arked t he first t wo colum ns and added a 3D pie chart , as shown in Figure 12- 8. So not only will you be able t o creat e chart s not available in Google Analyt ics—you can now also ut ilize t he Spreadsheet 's Share t ab t o let ot hers view j ust specific t raffic dat a of yours. ( Google Analyt ics has an access m anager t oo, but it won't allow you t o specify which t raffic dat a exact ly som eone is allowed t o see; sharing your page views, for inst ance, will also reveal t he m ost popular search t erm s used t o find your sit e.)

    A 3 D pie ch a r t visu a lize s you r r e fe r r e r st a t s

    H a ck 1 3 4 . Pr om ot e You r Sit e Usin g Google Ga dge t s Google Gadget s are j ust one of t he m any ways t o prom ot e your sit e. Post ing cont ent on YouTube, using a Creat ive Com m ons license [ Hack # 31] , or publishing an RSS feed, are j ust a few of t he ways t o enable people t o grab your cont ent and run wit h it . I f your sit e offers horoscopes, you can creat e a horoscope gadget wit h an opt ion t o cust om ize it t o one's st ar sign [ Hack # 60] . I f you have a page about horse racing, t hen you m ight offer a gadget displaying t he lat est race result s. I f your sit e cont ains t ips for t ourist s, you could offer a useful gadget showing t op spot s cust om ized by locat ion, or a Flash gam e advent ure called Surviving in Rom e. Furt herm ore, you could offer an iGoogle t hem e t o people [ Hack # 61] . I t 's wort h keeping in m ind t hat producing a gadget does not guarant ee big t raffic. Far from it ; j ust publishing a gadget does not aut om at ically m ake Google users find it , and you m ay end up wit h only a couple of subscribers t o your cont ent . Google som et im es shows off im pressive st at ist ics for popular gadget s, but well, t hese are t he popular gadget s, not average ones. And also, gadget views aren't anyt hing like page views, because a gadget is loaded by default every t im e t he user visit s t he Google hom e page t o perform a search. Con t a ct in g Blogs One t hing t hat helps t o get word out on your cont ent , be it gadget s or ot her sharable cont ent , is t o writ e t o bloggers in a niche relat ed t o yours. You can use Google Blog Search ( ht t p: / / blogsearch.google.com ) or plain old Google.com t o search for keywords like "horse racing blog" or "horse race news" —if your niche is horse racing—t o find som e of t he com m unit y sit es for t his t opic. When writ ing t o a blogger, it 's best t o be st raight forward and personal, and it 's worst —at least from m y perspect ive, m ileage of ot her bloggers m ay vary—t o j ust send out a t radit ional press release. Here is an exam ple of a m ail I would consider part icularly ineffect ive, and I 'll explain t he reasons aft er: Code View: Hello, We would like to inform you of our new virtual reality experience leveraging the latest in AJAX software, social content, and mobile phone management, to be released next week. Using HORS-O-RACE, a 3MB desktop program for which we will be glad to provide you a trial version if you are interested, users can immerse themselves in real-time race tracking information via our special HORS-O-RACE goggles which ...

    The em ail will go on at great lengt h, but you get t he idea. What was wrong wit h it ?

    The greet ing isn't personal, as it doesn't include t he blogger's nam e. This m akes it m ore likely t hat t he blogger will consider it a bulk m ail, and hit t he spam but t on.

    The prom ot ion put s t echnology before cont ent or use, suggest ing t hat what t he applicat ion delivers m ay be less int erest ing t han how it delivers it . . . and if t hat is t he case, it will probably be boring t o end users.

    The m essage is obfuscat ed by buzzwords, m aking it harder for t he blogger t o underst and it in t he t im e fram e devot ed t o reading t he m ail.

    The t ool offered requires an inst allat ion, which m eans addit ional download t im e, and worse, exposes t he blogger's syst em t o risks ( like a virus, or aut o- updat ing soft ware t hat consum es syst em resource and bandwidt h) .

    The t ool is paid, and includes dependencies—t he HORS- O- RACE goggles hardware—which m ay m ake t his hard for users, who t he blogger writ es for, t o t ry ( not wit hst anding t he problem t hat HORS- O- RACE is as of yet unreleased anyway) .

    Last not least , t he em ail does not include all t he necessary inform at ion for t he blogger t o st art writ ing a review about t his right away, should t hey decide t o do so, as t he t rial version was not included wit hin t he first m ail.

    Here is a m uch bet t er version of t hat m ail. Bloggers love t o get t ips and cont ent , so t here is no need t o beat around t he bush by writ ing eloquent pit ches—t he blogger will appreciat e t hat you sent a relevant t ip, helping t o provide cont ent ! Code View: Hello Jim, We just released our HORS-O-RACE web app for users to get the latest horse racing information. It's live at http://example.com/horse-or-race.html ... we're attaching a couple of screenshots exclusive for you, and hope this is something for your HorseRaceBlogger.example.com community. Best, ...

    This t im e, t he greet ing was personal. This t im e, you've direct ly explained what t he t ool does, and provided a public link t o a dem o. At t ached t o t he m ail are a couple of exclusive screenshot s, valuable t o any blogger who suspect s t hat t he sam e m ail m ight have been sent t o a dozen ot her bloggers ( m aking t he blog a m ere echo cham ber if it 's post ed) . The sent ence wit h an explicit reference t o t he HorseRaceBlogger com m unit y, on t he ot her hand, is one m ore signal t hat t his m ail was prepared by an act ual person knowing t he recipient , not a spam bot .

    Th e goa l: a m ost popu la r post s w idge t

    H a ck 1 3 5 . Roll You r Ow n An a lyt ics API for a " M ost Popu la r Post s" W idge t No Google Analyt ics API ? No problem ! I f you're like m e, you have a blog and use Google Analyt ics t o t rack visit or act ivit y. Also, you m ight want a " Most Popular Post s" sect ion on your blog, shown in Figure 12- 9, as it 's a great way for new visit ors t o find your best cont ent . The only problem is t hat t his would usually have t o be hard- coded, and would t herefore need updat ing periodically aft er you've checked t he Top Cont ent report in Google Analyt ics, or it would require som e server- side script ing and a dat abase t o t rack your page views and show t he links dynam ically. Wouldn't it be great if you could som ehow use Google Analyt ics t o display t he " Most Popular Post s" sect ion on your blog aut om at ically? That would be a huge t im e- saver for you and would m ake it m uch m ore useful for your visit ors, as it would always be up- t o- dat e. Unfort unat ely, Google Analyt ics doesn't have an API for t hat at t he t im e of t his writ ing ( t here's t he Analyt ics t racker snippet API , but it 's for anot her purpose) . But here's a m et hod t hat doesn't involve any server- side code or screen- scraping. All you need t o do is use a few exist ing free services from Google and Yahoo! and a bit of JavaScript .

    The hack used here will m ake som e of your Analyt ics dat a public, a t rade- off you m ay or m ay not want ; det ails are explained furt her short ly.

    Ba sic M e t h od

    1 . Obt a in t h e t r a ck in g da t a in a u sa ble for m a t . We can schedule Google Analyt ics t o em ail t his as an XML file on a regular basis.

    2 . M a k e t h e XM L file a cce ssible on lin e . By em ailing an at t achm ent t o Google Groups (ht t p: / / groups.google.com ) , t he file is aut om at ically given a public URL.

    3 . W or k ou t t h e URL of t h e m ost r e ce n t r e por t . As Google Groups provides RSS/ At om feeds for all m essages, we can easily find t he URL of t he m ost recent m essage and t herefore work out t he URL of t he XML report .

    4 . Pr e pa r e t h e da t a for u se . You need t o m anipulat e t he XML and m assage it int o a handy JSON ( JavaScript Obj ect Not at ion) form at t hat you can use on your blog, which can all be done using Yahoo! Pipes [ Hack # 126 ] .

    5 . D ispla y t h e lin k s on you r sit e . Wit h j ust a bit of client - side JavaScript , you can finally add a selfupdat ing " Most Popular Post s" sect ion t o your blog.

    There you have it ! Using your own Google Analyt ics dat a, you can creat e a com plet ely aut om at ed way of displaying your m ost popular post s t o your sit e visit ors. I f you're int erest ed in exact ly how I did t his, t he rest of t his hack expands on each st ep and t akes you t hrough

    t he ent ire process. Se t t in g Up t h e Google Gr ou p Because Google Analyt ics doesn't provide an API , or allow you t o link direct ly t o any export ed report s, you can use a Google Group t o host t he files, which you'll schedule Google Analyt ics t o em ail t o you. When you set up your Google Group, choose t he Announcem ent - only opt ion. Once creat ed, under t he " Group set t ings" m enu it em , select Access and m ake sure t hat t he following are checked: An ybody ca n vie w gr ou p con t e n t . Alt hough it would be preferent ial t o m ake t he group privat e, t hat would prevent public access t o t he feeds for t he group, which you'll need lat er. D o n ot list t h is gr ou p. Keeping t he group unlist ed m akes it less likely for som eone t o st um ble across your Analyt ics report s when searching Google Groups. Pe ople h a ve t o be in vit e d. This is so t hat no one else can post t o t he group, which would cause issues when t rying t o ret rieve t he Analyt ics m essage. Then click Save Changes. Alt hough you could em ail your report s direct ly t o t he Google Groups em ail address, each m essage would t hen cont ain an " opt - out " link, because it 's not t he em ail address t hat 's regist ered wit h Google Analyt ics. Given t hat t he m essages will be publicly available, you'll be using Gm ail t o forward t he m essages from t he sam e Gm ail address you use for Google Account s, so t hat if anyone m anages t o find t he Google Group, t hey can't st op t he scheduled report . Sim ply creat e a new filt er [ Hack # 44] and set it up as follows:

    I dent ify any em ail wit h Analyt ics in t he subj ect t hat also has at t achm ent s.

    Forward t he em ail t o your Google Groups em ail address.

    Skip t he inbox, so you don't have aut om at ed report s clut t ering up your inbox t oo.

    Se t t in g Up Google An a lyt ics I n Google Analyt ics, under t he Cont ent sect ion, view t he Top Cont ent report and change " Show rows" from 10 t o 50. ( You can't configure how m any result s t o include in your report any ot her way; it j ust rem em bers t he last set t ing you select ed.) Now click t he Em ail link but t on near t he t op of t he page, beneat h t he page t it le. Select t he Schedule t ab, t hen:

    Change t he report form at t o XML.

    Set t he dat e range/ schedule t o Mont hly ( unless you have a really act ive blog, in which case you m ight want t o keep it on Weekly) .

    Then click t he Schedule but t on at t he bot t om . To t est everyt hing, click t he Em ail but t on again, select t he Send Now t ab, choose XML as t he form at , and click t he Send but t on. I f everyt hing worked correct ly, aft er a few seconds your Google Group should have a Top Cont ent XML report in it !

    Ya h oo! Pipe s For t he next st ep, you'll need t he feed URL for your Google Group. You can get t his from t he orange XML but t on at t he bot t om of your group hom e page. Choose one of t he " New m essages" feeds, copy t he URL, and head on over t o Yahoo! Pipes. For t hose t hat don't know, Pipes at ht t p: / / pipes.yahoo.com is a really powerful service provided by Yahoo! t hat let s you fet ch dat a from all over t he Web and perform various operat ions on it , result ing in new or alt ered XML feeds/ JSON out put being creat ed, all done using a funky graphical int erface—not a line of program m ing code in sight ! The Yahoo! Pipe I 'm using is shown in Figure 12- 10 and can be found at : http://pipes.yahoo.com/pipes/pipe.info?_id=6vhLQfPC3BGM7_UDo_NLYQ

    A scr e e n sh ot of t h e Pipe

    Clone t his pipe, ( or, if you're feeling am bit ious, recreat e it using Figure 12- 10 as a guide) , and m ake t he following changes:

    Put t he address of your " New m essages" feed int o t he Fet ch Feed box at upper left of t he pipe.

    Modify t he Filt er at t he cent er of t he pipe t o choose t he correct pages from t he ones in t he report . I n Figure 12- 10 , I 've got it set up t o m at ch a com m on URL nam ing form at for blog post s ( year first ) . I f you're not get t ing any result s, click on t hat cent er Filt er, wait for Yahoo! Pipes t o refresh t he preview at t he bot t om of t he page, and see what you get t here. You m ay need t o m ake som e changes t o t he regular expression on t he filt er. For exam ple, if all your blog perm alinks st art wit h /blog, you m ight change t hem t o ^/blog/2005/.+, ^/blog/2006/.+, ^/blog/2007/.+, and ^/blog/2008/.+ respect ively.

    I n t he Loop in t he upper right of t he pipe, change t he st ring ( ht t p: / / cgriley.com ) t o som et hing appropriat e for your web sit e. The idea is t o concat enat e t he URL prefix from your web sit e wit h t he out put you see when you click on t he cent er filt er; t his result s in a valid link t hat can be clicked on t o visit t he page.

    For t hose not fam iliar wit h Yahoo! Pipes, here's a brief rundown of what you're m aking t he pipe do:

    Grab t he Google Groups XML feed and t runcat e it t o leave you wit h t he m ost recent m essage.

    Take t he m essage URL and m odify it t o get t he URL of t he XML at t achm ent ( basically replaces " m sg" wit h " at t ach" and appends " ?part = 2" ) .

    Select t he report dat a from t he XML at t achm ent and filt er out any links t hat you don't want t o include.

    Finally, using t he filt ered links, fet ch each blog post from t he web sit e t o ret rieve t he page t it le for use in t he link and t runcat e t he result s t o ret urn only t he t op five.

    The result is a JSON file cont aining t he t op five m ost popular blog post s based on t he m ost recent Top Cont ent report sent from Google Analyt ics t o t he Google Group. The file is locat ed at ht t p: / / pipes.yahoo.com / pipes/ pipe.run?_id= 6vhLQfPC3BGM7_UDo_NLYQ&_render= j son . I f you've cloned and m odified t he pipe for your own sit e, you save t he pipe, click Run t he Pipe, and t hen click t he More Opt ions but t on. Right - click t he Get as JSON link, and copy it s URL t o t he clipboard. D ispla yin g You r " M ost Popu la r Post s" The final st ep is t o t ake t he JSON dat a ret urned by Yahoo! Pipes and display t he cont ent s on your web sit e, which can be done using som e client - side JavaScript sim ilar t o t his ( replace t he bold 6 vh LQfPC3 BGM 7 _ UD o_ N LYQ wit h t he I D of your pipe) : Code View: Loading...

    Basically, t his m akes t he pipe execut e a JavaScript funct ion on t he web page by using a callback on t he JSON URL. To learn m ore about JSON, visit t he Yahoo! Developer Net work's JSON overview at ht t p: / / developer.yahoo.com / com m on/ j son.ht m l, or t he official hom e of JSON, ht t p: / / j son.org. This is a sim ple way of m aking your Google Analyt ics dat a available t o use in your own web pages and applicat ions. There are obviously som e privacy issues, as your report dat a is available for everyone t o see on Google Groups ( which can st ill be found doing a search, even when you used t he " Do not list t his group" set t ing) but if you t hink t hat 's a wort hwhile t rade- off for being able t o have a m aint enance- free t op post s sect ion, t hen t he world is your oyst er. And you're not rest rict ed t o displaying j ust your m ost popular post s. You could also use a sim ilar t echnique t o display your t op keywords, referring sit es, geographic locat ions, browsers—and anyt hing else t hat you can find in Google Analyt ics! Have fun m ashing up your Google Analyt ics dat a! — Chris Riley

    H a ck 1 3 6 . Con du ct a Use r Su r ve y Get t o know your sit e's visit ors by using an int erest ing Google Spreadsheet s feat ure. Google Analyt ics and ot her num ber- crunching st at ist ic program s already t ell you a lot about your sit e's visit ors. But t hey're not t oo good at get t ing across opinions, insight s, or wishes of your visit ors in regards t o your sit e. I f you want t o know m ore about your visit ors, why not conduct a survey and ask t hem direct ly? You don't need t o go far t o find a survey service: Google Spreadsheet s it self allows you t o creat e online form s t o poll users. Alt hough cert ain feat ures, like prevent ing m ult iple poll subm issions from a single user, are m issing at t he t im e of t his writ ing, t his m ay st ill be good enough for your uses. Here's how t o set up form s in Spreadsheet s. Go t o ht t p: / / docs.google.com and pick New Spreadsheet from t he on- page m enu. I n t he spreadsheet window t hat pops up, click on t he t it le of t he docum ent t o renam e it t o som et hing like " Sit e poll" ( once you give it a nam e, your docum ent will be aut om at ically saved) . Swit ch t o t he Share t ab, and below t he " I nvit e people" heading click t he radio but t on labeled " t o fill out a form ," as shown in Figure 12- 11 . Click t he " St art edit ing your form " but t on and a new form edit or window appears. I n t he form edit or, choose a t it le for your form and, opt ionally, a descript ion. Now ent er a quest ion; I 'm ent ering " How did you find out about t his websit e?" I 'm t hen choosing t he quest ion t ype " Mult iple choice," providing opt ions like " Through a friend's recom m endat ion" or " I found it via Google," as pict ured in Figure 12- 12 .

    Se t t in g u p t h e spr e a dsh e e t t o r e ce ive u se r in pu t

    N OTE Not e t hat t he difference bet ween t he answer t ypes " Mult iple choice" and " Checkboxes" is t hat t he lat t er allows for m ult iple select ions t o be m ade all at once ( " Mult iple choice" only allows a single select ion) . Anot her answer t ype called " Choose from a list " is sim ilar t o t he " Mult iple choice" t ype, except t hat it displays a collapsed com bo box, t hereby saving som e space in t he form .

    Add as m any quest ions and answers as you like—including free- form answers—and progress t o t he next st ep by hit t ing t he " Next , choose recipient s" but t on. You can now provide a list of people t o send t his survey t o and click " I nvit e people" ; recipient s will see your form right in t heir em ail body. For t he purpose of t his hack, however,

    t he goal is t o include t he survey on your sit e. To include it , first right - click t he link " Go t o live form " in t he form edit or window and copy it s URL t o your clipboard.

    Th e spr e a dsh e e t for m e dit or

    Now you can include an inline fram e on your sit e using t hat URL, as shown in t he sam ple HTML ( not e t hat for m ore elegant m aint enance, in case you repeat edly include such I Fram es, you m ight want t o m ove t he sam ple inline st yle shown int o an ext ernal CSS file) : Code View: A survey for you

    This exam ple displays as illust rat ed in Figure 12- 13 . And when your visit ors fill out t he form , your spreadsheet docum ent will be updat ed in real t im e, as shown in Figure 12- 14 ! Now begins t he harder part : changing your sit e and cont ent t o accom m odat e all t he user feedback t hat you'll receive.

    Th e w e b sit e poll displa ye d

    Th e su r ve y r e su lt s a r e a u t om a t ica lly in t e gr a t e d in t o you r spr e a dsh e e t

    H a ck 1 3 7 . Visu a lize Tr a ffic w it h D I Y Ve ct or Gr a ph ics Did you know t hat you can m ake t he browser display vect or graphics wit h j ust a few lines of code? Welcom e t o Canvas. Google Analyt ics already includes m any t raffic dat a visualizat ions. You can also export your num bers as CSV files [ Hack # 133 ] and im port t hem int o Google Spreadsheet s t o creat e new chart s. I n t his hack, you will learn how t o creat e your own t raffic chart using t he incredibly cool Canvas fram ework, which can produce vect or graphics and anim at ions wit h a lit t le bit of HTML and JavaScript . All code referenced in t his hack is also available in a single zip file at ht t p: / / blogoscoped.com / googleappshacks/ canvas.zip. Alt hough set t ing up Canvas m ay t ake a lit t le longer t han using, say, t he Google Chart s API [ Hack # 4] , it 's also m uch m ore flexible, and can even include anim at ed chart s. D r a w Som e t h in g Usin g Ca n va s Canvas is a vect or graphics fram ework which works in m ost popular browsers t oday including Firefox, Opera and Safari, and does not require a plug- in like Flash does. I nt ernet Explorer t oo can render Canvas code, at least wit h a lit t le t weak you'll see furt her below. Canvas can be used t o have a web page show 2D and 3D drawings, gam es, chart s, applicat ions, anim at ions, and m uch m ore. A longer canvas t ut orial is available at ht t p: / / developer.m ozilla.org/ en/ docs/ Canvas_t ut orial ( explaining how t o draw rect angles, curves, im port ed im ages, and m uch m ore) , but let 's j ust see what you need t o draw a sim ple line. First , creat e a file nam ed index.ht m l and open it wit h a plain t ext edit or. Creat e a basic page like t he following; Code View:



    Drawing a line

    Soon, a line will appear!

    So far, t hat 's all plain ( X) HTML. Now som ewhere in t he of t he page, put t he canvas t ag: ... Soon, a line will appear!

    ...

    Then, in t he sect ion of t he HTML, include a link t o a JavaScript file, which you will use t o draw t he line ( you'll creat e t his short ly) . Also, insert an onload call t o t he funct ion main() in t he body t ag, as shown here ( I 'm also adding an inline st yle; please include your own ext ernal st yle sheet t o define t he page layout as you see fit [ Hack # 18] ) : ...

    Drawing a line

    ...

    Next , creat e a default .j s file cont aining t he following JavaScript , and put it in t he sam e folder as index.ht m l: function main() { // grab the canvas var canvas = document.getElementById('picture'); var ctx = canvas.getContext('2d'); // set the color and line width ctx.strokeStyle = 'rgba(40,200,180,1)'; ctx.lineWidth = 8; // draw a line ctx.beginPath(); ctx.moveTo(40, 140); ctx.lineTo(240, 40); ctx.stroke(); }

    That 's not a lot of code—you're grabbing t he canvas elem ent using t he I D you defined ( picture) , t hen you're configuring t he line st yle, and t hen you're m oving t he line from st art point ( x and y) t o end point . Now open your index.ht m l file in a recent version of Opera, Firefox, or Safari, and you will see t hat a line is drawn, as shown in Figure 12- 15 ! I f you can't see a line, it 's t im e t o open t he debugging window; in Firefox, choose Tools Error Console from t he m enu. Ge t t in g Ca n va s t o W or k in I n t e r n e t Ex plor e r But wait a second. Didn't I prom ise t his would work in I nt ernet Explorer as well? Now here's t he caveat : I nt ernet Explorer doesn't nat ively support Canvas yet . Before you t ear your hair out ( or m ine) , or prepare a nast y let t er t o O'Reilly asking for your m oney back, let m e explain! Thanks t o a bunch of Google developers, it 's very easy t o get I E7 t o support Canvas, because t hese developers ( Em il A. Eklund, Erik Arvidsson, and Glen Murphy) wrot e a JavaScript library t hat em ulat es Canvas in I E's nat ive vect or language, VML ( short for Vect or Markup Language, not t o be confused wit h VRML, t he Virt ual Realit y Markup/ Modeling Language) . You can get ExplorerCanvas from ht t p: / / excanvas.sourceforge.net by following t he links t o t he download. Drop t he JavaScript file in t he sam e folder as your index.ht m l, and link it from t he HTML as shown here. Using t he condit ional com m ent s m eans t hat you won't be burdening any ot her browser but I E wit h t he 10 KB t he file is m ade up of, in it s com pressed file version:

    D r a w in g a lin e u sin g

    ...

    ...

    Phew . . . you are now ready t o open index.ht m l in I nt ernet Explorer, t oo. D r a w in g a Tr a ffic Ch a r t in Ca n va s Now t hat you know how t o set up Canvas, even if only t o draw a sim ple line, you've opened t he door t o a whole universe of vect or art ! Let 's use t his knowledge t o visualize t raffic dat a from Google Analyt ics. Log in t o one of Visit or Trending Visit s. Click t he your web sit e st at s at ht t p: / / analyt ics.google.com and choose Visit ors Export but t on and save t he XML download as st at s.xm l. You can open t he XML file in your browser t o have a look—it consist s of, am ong ot her dat a, point values showing visit s for t he last 30 days: ...

    29,430 January 29, 2008

    24,058 January 30, 2008

    ...

    To load t his XML file using JavaScript , you can use Aj ax ( Asynchronous JavaScript and XML, a way for web pages t o pull rem ot e dat a wit hout t he need for a full page reload) . At t his point , aft er changing t he files, upload t hem t o your server or run t hem on a server on your com put er—like WAMP, an Apache inst allat ion for Windows (ht t p: / / wam pserver.com ) —so t hat t he browser will grant t he script t he right s t o grab t he XML file. This exam ple won't work if you load it as a file:// URL. To cont inue, I 'm am ending t he files t hat were previously used for drawing a line ( you can also copy t he exist ing files int o a new folder and t hen am end t he copies, if you prefer) . Replace t he ent ire JavaScript so t hat it now reads as follows: Code View: function main() { // grab the XML via Ajax, using different methods, depending on the browser var url = 'stats.xml';

    if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { req = new ActiveXObject('Microsoft.XMLHTTP'); } req.onreadystatechange = receiveChart; req.open('GET', url, true); req.send(null); } function receiveChart() { // parse the XML into an array, removing commas from // numbers, and pass it to drawChart

    Code View: if (req.readyState == 4) { if (req.status == 200) { var timeFrame = 30; var d = req.responseXML.getElementsByTagName('Value'); var values = new Array(); for (var i = 0; i < timeFrame && i < d.length; i++) { var visits = d[i].firstChild.data; values[i] = parseInt( visits.replace(/,/g, '') ); } drawChart(values); } } } function drawChart(values) { // draw the chart while normalizing the display of // the lines based on the peak value of the array var peak = getMaxValueOfArray(values); var canvas = document.getElementById('picture'); var ctx = canvas.getContext('2d'); ctx.strokeStyle = 'rgba(40,200,180,1)'; ctx.lineWidth = 5; ctx.beginPath(); ctx.moveTo(0, canvas.height); for (var i = 0; i < values.length; i++) { var percent = getPercent(peak, values[i]); var x = i * (canvas.width / (values.length - 1) ); var y = (100 - percent) * (canvas.height / 100); ctx.lineTo( Math.round(x), Math.round(y) ); } ctx.lineTo(canvas.width, canvas.height); ctx.lineTo(0, canvas.height); ctx.stroke(); } function getMaxValueOfArray(values) { var max = 0; for (var i = 0; i < values.length; i++) { if (values[i] > max) { max = values[i];

    } } return max; } function getPercent(all, part) { return all > 0 ? 100 / all * part : 0; }

    Load index.ht m l in your browser t o see a chart sim ilar t o t he one shown in Figure 12- 16 . There are st ill t hings left t o be done t o fine- t une t he script , such as:

    Error handling t o alert you when som et hing is wrong wit h t he XML.

    Prevent ing t he XML from being cached t oo quickly in case you want t o updat e it .

    Pret t ifying t he chart or anim at ing it .

    but hopefully, t his exam ple has you ready t o delve deeper int o Canvas!

    D r a w in g a Ca n va s ch a r t ba se d on you r Google An a lyt ics st a t ist ics

    N OTE For m any m ore Canvas sam ples, check out ht t p: / / developer.m ozilla.org/ en/ docs/ Cat egory: Canvas_exam ples.

    H a ck 1 3 8 . Ta lk t o You r Visit or s " Chat back" is Google's nam e for a live help feat ure for your sit e. More t han idle chat t er, it can be an addit ional form of com m unicat ion on your sit e ( com plem ent ing t hings like com m ent form s, or your About page wit h cont act info like an em ail address) . Ot her t han m easuring your visit ors in m ere num bers, or conduct ing a survey [ Hack # 136 ] , you can also direct ly chat wit h visit ors t o get feedback! Google offers a chat badge t hat you can post ont o your blog or any ot her web page, m aking t his a sim ple undert aking, at least t echnically ( t aking t he t im e t o speak wit h your visit ors, and handling m ult iple conversat ions at once, is a different m at t er) . To get t he chat widget , visit ht t p: / / google.com / t alk/ service/ badge/ New and cust om ize t he badge by adj ust ing t he t it le and ot her opt ions. Your t it le of choice m ay be " Talk t o m e," " Have feedback? I 'm list ening," " Ask m e a quest ion," or anyt hing else. I f you edit t he configurat ion, click t he " Updat e badge" but t on t o refresh t he snippet . Copy t he snippet ( see Figure 12- 17 ) and past e it int o your blog soft ware's HTML edit ing t ab, or any ot her hom e page edit or of choice. ( For m ore valid HTML, you m ay want t o escape t he am persand charact ers in t he snippet 's URL by writ ing & inst ead of j ust &.)

    N OTE I f your t it le is t oo long for t he speech bubble, help is only a few charact er st rokes away: you can adj ust t he widt h param et er in t he URL, as well as t he I Fram e's width at t ribut e, t o expand t he lengt h of t he badge's speech bubble. The bubble's height can be adj ust ed t oo. For inst ance, you can change t he snippet part t hat reads w=200&h=60 t o w=400&h=80, and t hen change width="200" height="60" t o width="400" height="80".

    Log in t o Google Talk ( one way is t o open ht t p: / / t alkgadget .google.com / t alkgadget / popout in your browser) , and t hen go live wit h your blog post or t he changes you m ade t o your hom e page. The exact way t he widget displays depends on your configurat ions and your online st at us—if you've set your Google Talk st at us t o " busy," or you're logged out of chat , people won't be able t o launch a chat wit h you from t he chat badge. Now whenever you're available, visit ors can launch a chat wit h you by clicking on t he badge. They do not need a Google Account t o do so. And you will not be able t o ident ify t hem in any way ot her t han what t hey m ay reveal about t hem t hem selves, as t hey will show as " Guest ." Figure 12- 18 , on t he ot her hand, shows what t he chat will look like from t he visit or's end.

    Th is dia log t a k e s you t h r ou gh cr e a t in g a Google Ta lk ch a t ba ck ba dge ; you ca n e x pa n d a n d colla pse t h e a dva n ce d opt ion s via t h e Edit lin k

    W h a t t h e ch a t look s lik e for on e of t h e visit or s t o Ja n e 's blog

    H a ck 1 3 9 . A D iffe r e n t D ispla y for Google An a lyt ics Google Analyt ics AI R, also called Analyt ics Report ing Suit e, is a t hird- part y deskt op program t hat visualizes your Google Analyt ics num bers in quit e a different way. To run Google Analyt ics AI R, you first need t o inst all AI R, short for Adobe I nt egrat ed Runt im e. AI R is a fram ework for creat ing deskt op apps using Flash, HTML, and ot her t echnologies, and it 's available on different plat form s. Download t he ( current ly 11 MB) inst allat ion from ht t p: / / get .adobe.com / air/ and run it . ( A hat t ip t o Siggi Becker for point ing out t his hack.) Now t hat AI R is inst alled, download Google Analyt ics AI R from ht t p: / / about nico.be/ index.php/ downloads/ . There are m ult iple versions t o pick from ; I 'm using Bet a 3, because it 's m ade for t he version of AI R t hat I j ust downloaded. The file m ay end up as download.php on your syst em ; renam e it t o google- analyt ics.air. Thanks t o t his new ext ension, you can now launch t he program like you'd launch ot her program s. I n t he dialog t hat pops up, as shown in Figure 12- 19 , hit t he I nst all but t on ( if you t rust t his aut hor, as always) and follow t hrough wit h t he inst allat ion. Aft erwards, Google Analyt ics AI R opens and asks you t o choose an account . You can now eit her see a sam ple of t he program by choosing t he dem o profile, or add your own Google account .

    I f you do provide your Google account credent ials, again m ake sure t hat you t rust t he aut hor and t he soft ware, as wit h t he sam e password, it 's possible t o access your Gm ail em ails, your Blogger blog dashboard, your unlist ed Picasa album s and so on.

    I f you do want t o provide your Google account credent ials, add a profile nam e ( like " Google Apps Hacks" ) , your usernam e ( like " officehacks@gm ail.com " ) and your account password in t he profile dialog. Then hit t he " load" but t on and wait for a bit . You can t hen choose from different sit es wit hin t hat account , as shown in Figure 1220. Make a new select ion or leave as is, and click " Add profile." I f you opt ed t o see t he dem o dat a inst ead, click " Select profile" on t op, select t he Test Drive profile, and click " To dashboard." You will now end up on t he dashboard, as shown in Figure 12- 21 , wit h a left hand navigat ion allowing you t o see overviews, m ap overlays, new vs. ret urning visit ors, visit or loyalt y, and m ore.

    I n st a llin g t h e An a lyt ics Re por t in g Su it e

    Se t t in g u p you r pr ofile

    Th e n u m be r s fr om t h e sa m ple a ccou n t

    H a ck 1 4 0 . Follow t h e On lin e D iscu ssion Num ber- crunching apps like Google Analyt ics are not at all t he only t ool t o t rack your sit e and t he online discussion t hat evolves around it . St at ist ics show t he big num bers first —say, I m port ant Maj orWebsit e.exam ple.com sent 10,000 visit ors t o your blog post rant —but t hey oft en hide how t hat big sit e found your page in t he first place. This original reason t hat ended in a t raffic peak on your sit e is t he " t ipping point ." Knowing t he t ipping point is as im port ant as knowing I m port ant Maj orWebsit e.exam ple.com . Here are a couple of approaches t hat will help you underst and your sit e's place in t he great er schem e of t hings, and shed light on t he t ipping point s. You can t hen read up on what people elsewhere say about your sit e or service, and react t o it accordingly ( like im proving your sit e based on t he feedback, or, if necessary, clarifying your point of view) : H e a d ove r t o Google Blog Se a r ch a t ht t p:/ / blogse a r ch.google .com a n d e n t e r you r sit e 's URL, or you r pa ge 's URL, in t o t h e se a r ch box . Click t h e Se a r ch Blogs bu t t on . This will now display blogs point ing t o t hat URL, as shown in Figure 12- 22 . You can order t hese result s by dat e, and t hen m ove t o t he last result s page, so t hat you will see t he blogs t hat first linked t o your page. The sam e backlinks discovery can be perform ed via Technorat i at ht t p: / / t echnorat i.com . ( Not e t hat t hese services usually won't display all links which are out t here, and t hey m ay also som et im es get t he dat e ordering slight ly wrong.) Se t u p a Google N e w s Ale r t for m e n t ion s of you r sit e 's n a m e , or you r com pa n y or pr odu ct 's n a m e , or you r ow n n a m e . Just go t o ht t p: / / google.com / alert s?t = 1 ( log in t o your Google Account if necessary) , t ype a search t erm , and click Creat e Alert . You will now receive em ails when cert ain news sit es report on your sit e. Not e t hat you can com bine several keywords wit hin a single query. I f your sit e is called Acm e I nc. and t he product is called ACME2000, t hen t he search query can be: " acm e inc" | acm e2000 | " acm e 2000" | am ce2000. ( Yes, including t he m isspelled product nam e at t he end—as t his m ay be how som e news report s accident ally writ e it ! )

    Fin din g ou t w h o lin k s t o you r pa ge

    Ch e ck you r r e fe r r e r st a t ist ics. Log in t o Google Analyt ics at ht t p: / / analyt ics.google.com . Click on View Referring Sit es from t he left hand Report s t o j um p t o your sit e in quest ion, and t hen pick Traffic Sources navigat ion. I f necessary, expand t he list t o m ore t han j ust 10 result s by adj ust ing t he Show Rows but t on at t he

    bot t om . You will now find a list of sit es t hat linked t o your sit e and send over t heir visit ors. Click on a dom ain in t he list , and you will see a drill- down of specific subpages on t hat dom ain linking t o you. You can now click t he icon t o t he left of t hese subpages t o open t hem in a new window. Se a r ch Google for you r sit e 's n a m e , or t h e k e yw or ds of t opics you 'r e cu r r e n t ly discu ssin g. This will reveal ot her sit es discussing t he subj ect or your sit e—even when t hey don't happen t o link t o your sit e. To find links, you can also ent er link: exam ple.com int o Google web search ( replace " exam ple.com " wit h your dom ain) . Searching for keywords relat ed t o your area of focus will also ret rieve sit es and com m unit ies which are im port ant in t his field, but not discussing or linking your sit e. I t is im port ant for you t o know about t he I m port ant Maj orWebsit e.exam ple.com 's of your field. I t will aid your underst anding of t he online discussion and also offer ideas on where you could pot ent ially get involved. I f your sit e is about t he TV series " Heroes," for inst ance, you m ight want t o search Google for " heroes series," " heroes blog," " heroes forum ," and m ore, t o t hen check t he sit es t opping t he result s. Ch e ck w h e t h e r ( a n d h ow ) you r con t e n t is su bm it t e d t o socia l n e w s sit e s. Social news sit es, like Reddit .com or Digg.com , allow t heir users t o subm it point ers t o any web page. I ncluding yours, of course—and wouldn't it be nice t o know about t hat ? Usually, what you can do is head over t o t he social news sit e and search for your URL t o see if it has been subm it t ed. I f searching for URLs doesn't work, you can also oft en ut ilize t he sit e's URL subm ission collision checker ( even if you don't plan t o subm it your sit e yourself) . I f you h a ve a com m e n t syst e m on you r sit e , m a k e su r e t h a t you a r e a le r t e d t o n e w com m e n t s m a de t o old post s. Let 's say t wo years ago, you wrot e a blog post about t he life of long- forgot t en ast ronaut Jonat han R. Hum perdink. Nobody seem ed int erest ed at t he t im e, but an hour ago a m aj or Hollywood st udio announced t hat t hey'll t urn Hum perdink's life int o a film —and all of a sudden, int erest in t he subj ect , and your art icle, spikes. Your post will t hus get a lot of new com m ent s, but you m ay not check t he com m ent s t hread any m ore. I f, on t he ot her hand, your blog is set up so t hat you will get an alert for each new com m ent m ade, you will im m ediat ely know of t he spike. To set t his up on Google's Blogger.com , swit ch t o Set t ings Com m ent s. Scroll down t o t he Com m ent Not ificat ion Em ail field, and ent er your em ail address. Hit Save Set t ings t o com plet e.

    H a ck 1 4 1 . Be yon d Google : Click y, M in t , a n d Ot h e r s Google Analyt ics is j ust one of m any st at ist ics packages available. Before we delve int o t he alt ernat ives, t here's t he need for a word of caut ion:

    Tr a ffic n u m be r s a r e oft e n in com pa r a ble .

    Not all st at ist ic packages ret urn t he sam e t raffic num bers. Due t o differences in handling and wording, t here is som et im es great confusion and discrepancy surrounding t he values hit s, page views, page loads, visit s, visit ors, unique visit ors, uniques, and session, m aking t hese num bers oft en incom parable bet ween t he various t racking program s. For inst ance, what one program ident ifies as " visit " m ay be showing as an inflat ed " visit or" num ber in anot her program . Also, det ails are easy t o m iss when adding up num bers—such as t he absolut e unique visit or num bers of 30 days added up separat ely being m uch higher t han t he absolut e unique visit or num bers over a 30- day period t aken as a whole ( even Google Analyt ics—which oft en shows m ore conservat ive num bers t han m any ot her apps—got t his part ly wrong in t he beginning, t hough t hey lat er announced a bug fix) . I f you are asked for your t raffic num bers, t ry t o ensure t hat you are nam ing your t racker app and provide t he exact wording as your int erface shows it —including definit ions from t he app's help file where needed—and t hat t he person asking underst ands t hese issues and does not com pare num bers from incom parable st at s apps. Addit ionally, t ry providing values like average t im e spent on sit e or pages per visit if you believe t hat t hey help bet t er explain your sit e and audience.

    Here is an overview of som e of t he values t hat you m ay see pop up in your st at s cruncher app: H it : This is perhaps t he least useful value of all, as a hit m erely describes how oft en any resource on your server was request ed. This includes HTML files but also st ylesheet s, JavaScript files, im age files and so on. This num ber is oft en provided by st at ist ic program s working st raight on your server log files ( not t hose using a client - side, cookie- based approach) . Pa ge vie w : A page view bundles all hit s int o a single num ber. When t he visit ors st um bles upon a single page of yours, it m ay t rigger 55 hit s, but only 1 page view, t hus m aking t he value m ore m eaningful ( t hough in t he age of behind- t he- scenes dat a polling via Aj ax, a page view does not always t ell t he whole st ory, eit her) . Visit : A visit , also called a session, groups t oget her all t he consecut ive page views of a user. Usually, a 30 m inut e t im e- out bet ween t wo request s count s as a new visit . So if Joe visit s exam ple.com and browses 10 pages wit hin 10 m inut es, and t hen an hour lat er, Jane visit s exam ple.com from t he sam e I P address, 2 visit s will be count ed. Visit or : The visit or num ber groups t oget her all t he visit s from a specific person. This can be done by script s dropping a cookie on t he client com put er ( which works correct ly, as long as t he cookie isn't delet ed, and as long as t he person doesn't visit t he sit e from different com put ers) . Google Analyt ics calls t his t he " Absolut e Unique Visit or" value, m ore clearly different iat ing it s nam e from t he " visit " value ot her st at ist ic packages m ay use. But again—what one program m ay call a " visit ," anot her m ay call a " visit or." And one num ber m ay not necessarily be m ore useful t han t he ot her. I m agine t hat you're being asked, " How m any cars drive t hrough your hom e st reet on a t ypical day?" To com e up wit h an answer, do you count every car t hat passes by t he st reet on a given day . . . or do you only count t hose cars you haven't seen before t hat day, in case people drive t hrough t he st reet once in t he m orning and once in t he evening?

    Alt e r n a t ive s or Com pa n ion s t o Google An a lyt ics Wit h t he differences bet ween analyt ic packages in m ind, here are som e ot her ways t hat you can crunch t he num bers com ing in from your sit e: Click y ( ht t p: / / get clicky.com ) : Clicky, as shown in Figure 12- 23 , displays your t raffic num bers in light weight overviews. They also provide som e real- t im e dat a via t heir " Spy" t ab, showing you how visit ors int eract wit h your sit e at a given m om ent . Clicky also support s t racking int eract ive Aj ax or Flash applicat ions, and visualizes dat a using such approaches as Google Maps m ashups or t ag clouds. St a t Count er ( ht t p: / / st at count er.com ) : The free St at Count er service, as shown in Figure 12- 24 , is a bit m ore of an " old- school" t raffic t racker. Aft er regist ering and insert ing a piece of code from t hem in your blog or ot her web sit e, you'll be able t o find out about such t hings as popular pages, exit pages, keyword analysis, visit or pat hs, browser usage st at s and m ore. Not e t hat you can decide whet her you want t he St at Count er t racker widget t o be invisible on your sit e. Sit e M e t e r ( ht t p: / / sit em et er.com ) : Sim ilar t o St at Count er, Sit e Met er breaks up t he different t raffic aspect s in a left hand navigat ion and t hen visualizes num bers t o t he right hand cont ent area. The default view is shown in Figure 12- 25 . The sit e is ad- support ed, like ot her st at ist ic services, so you'll be seeing banner anim at ions t o t he t op and right ( unless you have an ad blocker inst alled, t hat is) . Visit or Ville ( ht t p: / / visit orville.com ) : Visit orVille can get it s dat a eit her st raight from your raw server logs, or via a t racker snippet you include in your t em plat e. Once dat a is com ing in, it will be displayed in a surprisingly real- t im e and visual way—by showing your sit e as a cit y, as pict ured in Figure 12- 26 , wit h visit ors driving around, or a Google bus delivering a visit or when som eone searched for your sit e ( audio clues are at t ached t o t hese event s so t hat you can part ly t rack your t raffic even when t he program is m inim ized, j ust by list ening) . When you want t o know m ore about a part icular visit or, you can right - click t he visit or avat ar t o open t heir " passport ," showing det ails like t he visit or locat ion, search t erm s and m ore—and you can even init iat e a chat wit h t hem . Visit orVille, available in full 3D or isom et ric 2D, is paid soft ware ( st art ing at $6.95 per m ont h, depending on your t raffic) , and also available as a free t rial download. M in t ( ht t p: / / haveam int .com ) : This st at s app cost s a one- t im e $30 per sit e, which will provide you wit h a PHP package t o set up on your dom ain ( as Mint is not a host ed service) . For a live sam ple dem o of Mint , check out ht t p: / / designologue.com / m int / , as pict ured in Figure 12- 27 .

    Click y

    St a t Count er

    Sit e M e t e r

    Visit or Ville

    M in t

    For m ore t racking program s, also t ake a look at WebTrends ( ht t p: / / webt rends.com ) , AWSt at s (ht t p: / / awst at s.sourceforge.net) , MyBlogLog ( ht t p: / / m ybloglog.com ) , OneSt at ( ht t p: / / onest at .com ) , and WebSTAT (ht t p: / / webst at .com ) . Happy webm ast ering!

    CRED I TS H a ck . Abou t t h e Au t h or Ph ilipp Le n sse n from Germ any is edit or and writ er behind Google Blogoscoped ( ht t p: / / blogoscoped.com ) , a news sit e and com m unit y covering Google, search engines, and web t echnology in general. The blog was st art ed in Malaysia in 2003 and is current ly m aint ained wit h a great deal of help from people all over t he globe. Philipp likes t o program , draw or design, and writ e, and he creat ed or co- creat ed websit es like Gam esfort heBrain.com , CoverBrowser.com , and Sket chSwap.com . When Philipp's not pondering t he possibilit ies t he I nt ernet brought us, he's hopefully violent ly pulled away from his lapt op by his wife Shan.

    H a ck . Con t r ibu t or s The following people cont ribut ed t o t his book in t he form of hacks: Ton y H ir st from t he UK, is a lect urer in art ificial int elligence, and blogs about his Google and Yahoo relat ed hacks and m ore at ht t p: / / ouseful.info. Since 2001, Tony has been act ively involved in educat ional robot ics research. Br ia n Je pson is Execut ive Edit or for Make Magazine's Make: Books series, and has writ t en and edit ed a num ber of geeky books. He's also a volunt eer syst em adm inist rat or and all- around geek for AS220 ( ht t p: / / as220.org) , a non- profit art s cent er t hat gives Rhode I sland art ist s uncensored and unj uried forum s for t heir work. Re t o M e ie r ( ht t p: / / blog.radioact iveyak.com ) is a developer and t echnology writ er current ly living in London. As of lat ely, t he Google Android m obile plat form has piqued his special int erest . Ch r is Rile y of ht t p: / / cgriley.com is a web developer from t he UK. I n his spare t im e, he likes t o m ess about wit h various web API s t o creat e int erest ing and useful m ashups.

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ]

    I n de x [ SYM BOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] ( OPML) 2D t ext 30 Boxes calendar 3D t ext

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] abbr eviat ions currency languages Adblock Plus addresses book, Gm ail Gm ail, m ult iple obfuscat ed Adobe Acrobat Adobe I nt egrat ed Runt im e ( AI R) Adobe Phot oshop, Save for Web advert isem ent s, Gm ail Agarwal, Am it AI R ( Adobe I nt egrat ed Runt im e) Alan/ Garet t Rogers album s Flickr Picasa ident it y Picasa, creat ing Picasa, geot agging im ages Picasa, st orage space alert s feeds forum s, new post s Am nest y Generat or Apple Address Book argum ent s, GoogleLookup values art. See also im ages ASCI I 2nd Canvas, t raffic visualizat ion Unicode Arvidsson, Erik ASCI I art 2nd Ask m aps ast ronom y at t achm ent s Gm ail icons Gm ail, docum ent s at t ribut es, GoogleFinance aut o- fill

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] backgrounds, cust om , present at ions backing up files Gm ail backlinks 2nd Becker, Siggi Bet t er Gm ail 2 Beyond Com pare billing, m obile phone bird's eye view, Live Maps Blip.t v BlogBinder s Blogger backlinks em ail em bedding YouTube videos experim ent al feat ures Google docum ent s, edit ing navigat ion bar t em plat es widget s Blogger Draft blogging. See also feeds alert s alt ernat ive soft ware Blogger experim ent al feat ures browsers, t est ing CAPTCHAs changed t ext chat back com m ent spam com m ent s, disabling 2nd com m ent s, em ail not ificat ions com m ent s, m oderat ing com paring post versions credit ing sources em ail em bedding calendars 2nd em bedding present at ions em bedding spreadsheet s em bedding YouTube videos 2nd FriendFeed gadget s, adding Google docum ent s, edit ing im port ing dat a from web sit es Live Spaces LiveJournal Movable Type navigat ion bar, hiding nofollow overview popular post widget prom ot ing web sit es wit h gadget s publishing as book server URLs

    st r iket hr ough t em plat es t ext im ages t ipping point t racking backlinks Tum blr Twit t er TypePad " via" line widget s Wor dPr ess Bloglines Blogspot Google docum ent s, edit ing navigat ion bar, hiding bookm arklet s iGoogle t hem e edit or search and replace t ext t able of cont ent s, linked bookm arks Firefox, short cut s searching unread em ail skipping Google Analyt ics login box books, publishing blogs borders 2nd BrowserPool browsers cont ext m enus viewing web sit es bullet in boards Burkholder, Bryan business locat ions, Google Maps

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] calculat or calendars 30 Boxes Hot m ail Yahoo! Calendar Canvas, t raffic visualizat ion CAPTCHAs capt ions Google Video YouTube Cascading St yle Sheet s ( CSS) cust om t hem es, present at ions docum ent st yles Gm ail layout Google Talk ChangeDet ect ion charact ers, special Gm ail signat ures Google docum ent s chart s, em bedding chat . See Google Chat ; Google Talk box, spreadsheet sharing window, docum ent sharing chat back Chinese charact ers Chit u, I onut Alexandru 2nd 3rd chrom eless player, videos Click y clip art clips, Google Reader collaborat ing docum ent s m aps sharing not es color cust om t hem es, present at ions em bedded videos spreadsheet cells com m ent s, blog disabling 2nd em ail not ificat ions m oderat ing nofollow spam com paring file versions com pose new m ail short cut com pressing files, present at ions condit ional form at t ing cont act s export ing, Gm ail groups, Gm ail im port ing, Gm ail cont ent m anagem ent syst em cont ext m enus, Google Maps conv ent ions

    Conversat ion Preview convert ing currencies Copy Plain Text copying layout s Mac OS X t ext , rem oving form at t ing Creat ive Com m ons im ages 2nd v ideos cron j ob CSE ( Google Cust om Search Engine) CSS ( Cascading St yle Sheet s) cust om t hem es, present at ions docum ent st yles Gm ail layout Google Talk currencies, convert ing cust om Google Analyt ics dashboard invit at ion groups placem ark icons t hem es, present at ions t oolbar but t ons Cut ePDF Cut t s, Mat t

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] Daily Me gadget Daily Product I m age gadget dashboard, Google Analyt ics 2nd dat a cont ent m anagem ent syst em Edit Grid Web Dat a Google Base Google Maps overlays Google Spreadsheet s, aut om at ically updat ing im port ing im port ing Google Analyt ics dat a t o spreadsheet popular post widget st ock dat es difference bet ween form at , search and replace weekday or m ont h days and hours, convert ing values deskt op short cut icons, creat ing new docum ent s Digit al I nspirat ion Dingbat s, Gm ail signat ures disabling blog com m ent s 2nd blog navigat ion bar discussion forum s. See also Google Groups ads, hiding Drupal m onit oring new post s phpBB st icky t hreads vBullet in dit hering docum ent s Think Fr ee Zoho dom ain host ing services nam es, search and replace downloading videos DownThem All Greasem onkey script drag and drop im ages Drupal

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] Edit Grid Edit or, Google Gadget Eklund, Em il A. em ail addresses, search and replace alert s, new discussion post s blog com m ent not ificat ion blogging Hot m ail 2nd Thunder bir d 2nd 3rd Yahoo! Mail em bedding calendars 2nd dynam ic chart s iGoogle, screenscraping m aps m ult iple YouTube videos present at ions in web pages spreadsheet s in web pages videos, blogs videos, color videos, resizing em ot icons em Tube encrypt ion, Gm ail endnot es, rem oving references Erle, Schuyler errors diffusion form ulas event list ener, em bedded m aps event s geocoding Google Calendar, m obile phone Quick Add web cont ent Excel Hacks 2nd 3rd experim ent al feat ures Blogger Google ExplorerCanvas ex por t ing cont act s, Gm ail feed subscript ions files from Google docum ent s files from Google Present at ions files from Google Spreadsheet s Google Analyt ics dat a t o spreadsheet Google Not ebook t o Google docum ent s present at ions spreadsheet dat a as HTML expressions, regular, search and replace t ext Eyespot

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] Fair Use 2nd favicons feeds alert s 2nd Bloglines calendar, geocoding calendars com paring file versions docum ent changes FriendFeed gadget s Google News Google Reader, overview Google, subscribing t o HTML icon iGoogle Kinj a Live Bookm arks m obile phone m oving subscript ions Net NewsWire Net vibes Picasa, screensaver searching SendMeRSS SharpReader Wikipedia file explorer files at t aching t o m ail backing up com paring versions, Google Reader convert ing Word t o PDFs form at s, convert ing form at s, opt im izing form at s, WMV Gm ail at t achm ent icons local, opening local, saving size, present at ions st orage space, Gm ail st orage space, Gm ailFS filt ers Gm ail 2nd 3rd Yahoo! Pipes Find/ Replace Firefox alert s, feeds backing up files Bet t er Gm ail 2 bookm ark keywords Gm ail layout Gm ail m acros local files, opening

    Quick Add skipping Google Analyt ics login box St ylish t oolbar but t ons Flash allowing gam es Google Analyt ics Flash Video ( FLV) Flickr flight sim ulat or float ing t ext / im ages FLV ( Flash Video) folders, Gm ail Font I m age Generat or font s docum ent layout Font I m age Generat or present at ions special charact ers form at s convert ing, docum ent s convert ing, video FLV ( Flash Video) im ages KML video WMV form at t ing. See also layout s; st ylesheet s cells by value copying layout s im ages, borders 2nd im ages, loading t im e rem oving, past ing t ext st yle sheet s form s, spreadsheet s form ulas errors GoogleFinance GoogleLook up forum s. See also Google Groups ads, hiding Drupal m onit oring new post s phpBB st icky t hreads vBullet in forwarding m ail 2nd Founders at Work fram es, inline Friedl, Jeffrey E.F. FriendFeed 2nd

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] gabrit o.com gadget s. See also widget s blog, adding Blogger cont ent , searching creat ing Daily Product I m age Flash gam es Google Deskt op Google Gadget Edit or Google Maps Google Reader Google Talk hom e page host ing iGoogle, adding iGoogle, Google News iGoogle, overview iGoogle, screenscraping Net vibes Pageflakes program m ing prom ot ing web sit es Prot opage quirks m ode Recom m ended News RSS feed t racking t raffic gam es, Flash, iGoogle GDat aCopier Gdrive GeoCit ies geocoding, calendar XML feeds geot agging im ages Gibson, Rich GI F form at GI MP, Save for Web plugin Gm ail address book advert isem ent s alt ernat ives at t aching files at t achm ent icons backing up Bet t er Gm ail 2 cont act groups Conversat ion Preview Drive encr y pt ion export ing cont act s feeds filt ers 2nd 3rd folders forwarding t o m obile phone Google Chat

    Google Talk Greasem onkey script s caut ion im port ing cont act s keyboard short cut s layout 2nd m obile phone access m ult iple addresses organizing m ails overview perm alinks search search, languages signat ur es 2nd signing up st orage space super clean viewing unread em ail Gm ailFS Goodm an, Danny Google Account locking obt aining Google AJAX Feed API Google Analyt ics AI R ( Adobe I nt egrat ed Runt im e) alt ernat ives dashboard 2nd display export ing dat a t o spreadsheet feedback solut ions Flash overview prom ot ing web sit es wit h gadget s Report ing Suit e search engine opt im izat ion ( SEO) skipping login box t ipping point t racking gadget t raffic t racking ident ifier widget s Google Apps overview Google Base, dat a st orage Google Blog Search 2nd 3rd Google Blogoscoped Google Calendar alt ernat ives em bedding 2nd event s, m obile phone geocoding XML feeds link t o m aps m obile phone access 2nd overview public calendars Quick Add Rem em ber t he Milk t o- do list sharing St ylish Sync t o- do list s weat her forecast s web cont ent event s Google Chart s API em bedding dynam ic chart s

    request lim it s Google Chat Google Cust om Search Engine ( CSE) Google Deskt op, gadget s Google Docs alt ernat ives collaborat ing cust om invit at ion groups em bedding dynam ic chart s feeds file explorer files, backing up help group logging in m obile phone access overview short cut s, creat ing new docum ent s short cut s, exist ing docum ent s social net work Google docum ent s ast ronom y backing up files blogging, edit ing collaborat ing convert ing Word files t o PDFs creat ing new cust om invit at ion groups em bedding dynam ic chart s feat ures file t ypes flight sim ulat or Google Not ebook m obile phone access overview past ing t ext public calendars publishing refreshing view RSS feed, docum ent changes search and replace t ext Share set t ings short cut s, creat ing new spreadsheet s skydom e special charact ers st yle sheet s t able of cont ent s, linked Google Eart h Blog Google Experim ent al Google Finance Google Gadget s, m applet s Google Gears Google Groups ads, hiding alt ernat ives knowledge bases m onit oring new post s overview popular post widget st icky t hreads Google Labs Google Local Business Cent er Google Lookup Google Maps API em bedding m aps

    geot agging im ages m applet s package t racking Google Maps Hacks Google Maps. See also Google Eart h; Google Sky alt ernat ives business locat ions, adding cont ext m enus, displaying em bedding m aps gadget s geocoding calendar feeds Google Mars Google Moon layers, adding link t o calendars m obile phones overlays overview placem ark icons t racking packages Google Mars Google Moon Google Music Google News 2nd Google Not ebook 2nd Google Operat ing Syst em blog Google Pack screensaver Google Page Creat or gadget s, adding overview search box Google Present at ions accessibilit y backing up files chat box cust om invit at ion groups cust om t hem es em bedding in web pages file size file t ypes im ages, drag and drop im ages, finding m obile phone access m usic PowerPoint t em plat es publishing readabilit y sharing short cut s, creat ing new spreadsheet s sm all v ideos Google Q&A Google Reader alert s alt ernat ives com paring file versions iGoogle m obile phone m oving subscript ions offline use overview short cut s subscribing t o feeds t racking packages

    t racking Wikipedia Google Set s 2nd Google Sit es 2nd Google Sket chUp advanced t ools overview plug- ins Ruby script s st yles Google Sky Google Spreadsheet s aut om at ically com plet e list s backing up files cont ent m anagem ent syst em convert ing currencies cust om invit at ion groups dat a, aut om at ically updat ing dat e, weekday or m ont h dat es, difference bet ween em bedding dynam ic chart s export ing Google Analyt ics dat a file t ypes form at t ing cells by value form s form ula errors im port ing dat a from web sit es local files, opening Magic- Fill m obile phone access placem arks random sort ing sharing short cut s, creat ing new spreadsheet s t im e, days and hours form ula user surveys web pages, em bedding Google Talk 2nd Google Toolbar, local files, opening Google Video alt ernat ives linking t o specific st art ing point offline use subscr ibing subt it les vs YouTube Google Web Search GoogleDocsDownload Greasem onkey script googleReader funct ion Googling Google gradient s, cells graphical signat ures, Gm ail Greasem onkey backing up files Bet t er Gm ail 2 Gm ail at t achm ent icons Gm ail Conversat ion Preview Gm ail folders Gm ail HTML signat ures Gm ail m acros Gm ail super clean m usic video lyrics Persist ent Searches script s caut ion t o- do list s

    groups. See also Google Groups cont act , Gm ail cust om invit at ion present ing t o RSS feed, docum ent changes sharing calendars sharing docum ent s sharing not es spreadsheet sharing

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] Hawley, David and Raina 2nd 3rd hearing- im paired, Google Video subt it les Hello World gadget help group, Google hidden im ages in em ail host ing, gadget Hot m ail address book calendar overview HTML calendar feeds Canvas, t raffic visualizat ion Cascading St yle Sheet s ( CSS) em bedding m aps em bedding spreadsheet s in web pages feeds Gm ail m obile phone access Gm ail signat ures im port ing dat a from web sit es linking t o I Ds m applet s present at ion links search and replace t ags, rem oving validat ing Hurbain, Philippe Huss, Todd

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] iCal icons feeds Gm ail at t achm ent s placem ark short cut , creat ing new docum ent s weat her forecast s ident ifier, t racking ident it y, Picasa iFilm iFram e, gadget s ifram es iGoogle alt ernat ives Daily Product I m age gadget Flash gam es gadget s, adding gadget s, creat ing gadget s, program m ing Google Gadget Edit or Google News Google Reader Google Talk Hello World gadget overview Recom m ended News RSS feed screenscraping t hem es t racking gadget t raffic igThem er I llust rat ed Guide t o Ast ronom ical Wonders I m ageMagick 2nd im ages ASCI I art 2nd borders 2nd Creat ive Com m ons 2nd cust om t hem es, present at ions Daily Product I m age gadget em bedding dynam ic chart s Fair Use Flickr float ing t ext / im ages geot agging Google Chart s API hidden in em ail Picasa feeds, screensaver Picasa web album s planet s present at ions, drag and drop public dom ain t ext , blogs Unicode art I MAP, Gm ail m obile phone access iMovie

    im port Dat a funct ion im port Feed funct ion im port Ht m l funct ion im port ing cont act s, Gm ail convert ing currencies dat a from web sit es feed subscript ions files t o Google docum ent s files t o Google Present at ions files t o Google Spreadsheet s Google Analyt ics dat a t o spreadsheet im port XML 2nd indexing, Google Cust om Search Engine ( CSE) I nfoMinder inline fram es 2nd inlining gadget s I nt ernet Explorer Canvas feed bookm arks Gm ail layout invit ing collaborat ors cust om groups m aps overview iPhone Google Calendar YouTube videos iPhot o, m ovies isnoop.net

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] Java, Gm ail m obile phone access JavaScript Canvas, t raffic visualizat ion cont ent m anagem ent syst em em bedding m ult iple YouTube videos m applet s regular expressions search and replace t ext t able of cont ent s, linked JavaScript & DHTML Cookbook JPEG form at JSON parser library 2nd Jum pcut j ust ifying t ext

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] KeepVid keyboard short cut icons, creat ing new docum ent s short cut s, Gm ail Keyhole Markup Language ( KML) 2nd keyword, bookm ark, skipping Google Analyt ics login box Kinj a KML ( Keyhole Markup Language) 2nd knowledge bases Google Groups Google Sit es Konieczny, Piot r Kurisi, Yoshiom i

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] labels, Gm ail 2nd lang operat or languages Gm ail search special charact ers, Google docum ent s layers, m aps layout s cust om , present at ions docum ent s Gm ail layout Google Calendar Google Talk layout s. See also form at t ing; st ylesheet s copying, Google docum ent s Google Calendar let t er spacing Lifehack.org Lifehacker.com line height , t ext linkfarm s links backlinks 2nd geocoding event s Gm ail perm alinks Google Video, specific st art ing point linkfarm s m aps t o calendars nofollow paid sharing m aps t able of cont ent s, Google docum ent s list s aut om at ically com plet e random sort ing Live Bookm arks Live Search Maps Live Spaces LiveJournal Livingst on, Jessica local files opening saving lossless com pression form at Lulu.com lyrics, m usic video

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] Mac OS X address book convert ing files t o PDFs copying Gm ail layout m ovies past ing short cut s, creat ing new docum ent s special charact ers, Google docum ent s m acros, Gm ail Magic- Fill m applet s MapQuest m aps. See also Google Maps Ask m aps Live Search Maps MapQuest Yahoo! Local Maps Marek, Tom asz Mars, Google Maps m ashups, m aps Mast ering Regular Expressions Mint 2nd m obile phone Gm ail access Gm ail, forwarding m essages Google Calendar access Google Docs access Google Reader plan charges sending sent ences m obile phones Google Maps Google News YouTube videos MobiTubia m oderat ing blog com m ent s MONTH Moon, Google Maps Movable Type 2nd Mozilla Prism Thunderbird, address book Thunderbird, backing up em ail Murphy, Glen m usic. See also Google Music present at ions video lyrics MySQL, Google Maps overlays

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] navigat ion bar, blogs, hiding Net NewsWire Net vibes 2nd nofollow not es, Google Not ebook not ificat ions blog com m ent s forum s, new post s

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] obfuscat ed addresses off- page web sit e opt im izat ion Office files, opening offline use downloading videos Google Reader on- page web sit e opt im izat ion opening local files OpenOffice files, opening Opera Mobile OPML ( Out line Processor Markup Language) opt im izat ion file size, present at ions search engine web sit es, off- page web sit es, on- page Out look Express, address book

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] packages, t racking Pagecast Pageflakes Parallels Parparit a, Mihai passwords, docum ent sharing past ing docum ent s int o em ail Mac OS X t ext , rem oving form at t ing PDFs convert ing Word files pdft oht m l ut ilit y perm alinks, Gm ail Persist ent Searches PHP cont ent m anagem ent syst em , web page discussion group dynam ic iCal files Google Analyt ics AI R iGoogle gadget s Mint signat ure generat or phpBB Picasa album s, creat ing feeds feeds, screensaver geot agging im ages ident it y signing up st orage space Pingdom .com Pinyin placem arks Google Map layers Google Map overlays, KML icons planet s, Google Maps players, FLV plug- ins, Google Sket chUp PNG form at podcast s POP, Gm ail m obile phone access popular post widget PowerPoint t em plat es present at ions Think Fr ee preview, Gm ail program m ing calendar feeds Canvas, t raffic visualizat ion code exam ples em bedding m aps em bedding m ult iple YouTube videos

    gadget s Google Maps overlays Google Sket chUp, Ruby script s iCal m applet s regular expressions, search and replace t ext t able of cont ent s, linked prom ot ing web sit es wit h gadget s Prot opage pseudographical signat ures, Gm ail public calendars 2nd 3rd public dom ain im ages publishing blogs, Google docum ent s docum ent s 2nd docum ent s as web pages em bedded chart s present at ions public calendars spreadsheet as HTML publishing blogs at books pushpins, Live Maps Pyt hon Gm ailFS Google Maps overlays script , backing up files

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] queries Google Finance Google Q&A Quick Add quirks m ode, gadget s

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] RAND random sort ing Real Tim e St ream ing Prot ocol ( RTSP) Recom m ended News refreshing view regex regular expressions popular post widget search and replace t ext Rem em ber t he Milk t o- do list rem oving collaborat ors rem oving form at t ing, t ext request s, lim it s, Google Chart API resam pling resizing em bedded videos files, present at ions Rev v er RTSP ( Real Tim e St ream ing Prot ocol) Ruby script s, Google Sket chUp Ruscoe, Tony

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] Safari feed bookm arks Gm ail layout Save for Web plugin saving local files screensavers, Picasa feeds screenscaping convert ing currencies Edit Grid Web Dat a iGoogle im port ing dat a from web sit es screenshot s Google Eart h, skydom e slides search feeds gadget s Gm ail Gm ail, languages Gm ail, linking t o Google Blog Search 2nd Google Cust om Search Engine ( CSE) Google Experim ent al Google Web Search public calendars relat ed web sit es replacing t ext unread em ail search engine opt im izat ion ( SEO) securit y allowing Flash blog com m ent spam CAPTCHAs docum ent sharing em ail blogging Gm ail Google Groups im ages in em ail nofollow SendMeRSS SEO ( search engine opt im izat ion) Share set t ings sharing clips, Google Reader cust om invit at ion groups docum ent collaborat ion 2nd files t hrough em ail Google Calendar m aps not es Share set t ings t o- do list s SharpReader short cut s com pose new m ail

    creat ing new docum ent s em bedded videos files, present at ions Gm ail 2nd Gm ail, keyboard Google Reader KeepVid present at ions, em bedded Sit e Met er t ext , blogs skins Google Calendar iGoogle skydom e, Google Eart h sm ileys SMS forwarding Gm ail t o m obile phone Google Calendar alert s Sm ust ard song lyrics spam blog com m ent s Gm ail signat ures Google docum ent s searching Spik e Spolsky, Joel spreadsheet s chat box Edit Grid Think Fr ee St afford, Jam es St at Count er st icky t hreads st ock dat a st orage space Gm ail Picasa st riket hrough, blogging St rom , Mot t i st yles, Google Sket chUp St ylish subscr ibing. See also RSS feed alt ernat ive readers discussion t hreads Google feeds m oving subscript ions public calendars RSS feed, docum ent changes Subt it le Horse subt it les Google Video YouTube surveys, user sym bols, Gm ail signat ures synt ax, regular expressions

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T ] [ U] [ V] [ W] [ X] [ Y] [ Z ] t able of cont ent s, linked Taylor, Frank Technor at i.com t em plat es blogger layout s PowerPoint t ext 2D 3D convert ing Google Not ebook t o Google docum ent s float ing t ext / im ages Font I m age Generat or font s im ages, blogs j ust ifying let t er spacing line height past ing, rem oving form at t ing search and replace special charact ers st yle sheet s uppercase word spacing t hem es cust om , present at ions Google Talk iGoogle planet im ages Think Fr ee Thom pson and Thom pson t hreads, forum s m onit oring new post s st icky Thunder bir d address book backing up em ail overview t im e, days and hours t ipping point , t raffic t o- do list s t oolbars but t ons, m oving Tordoff, St ephen Torres, Elias Trace Research and Developm ent Cent er t rackbacks TrackEngine t racking backlinks pack ages t raffic, t racking Click y gadget s ident ifier

    Mint 2nd popular post widget Sit e Met er St at Count er st at ist ics applicat ions t ipping point t racking, applicat ion discrepancies Visit orVille 2nd visualizat ion, Canvas Wikipedia Trapani, Gina t rash, searching Trazo, Hildo Tum blr Twit t er TypePad t ypographical convent ions

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] Undo, search and replace t ext Unicode charact ers Gm ail signat ures Google docum ent s unlist ed m aps unread em ail uppercase t ext URLs calendar feeds docum ent sharing em bedding dynam ic chart s Gm ail links Google Map overlays Usenet em ail alert s User I nt erface Design for Program m ers user surveys

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] validat ing HTML vBullet in Veoh versions com paring files revert ing, search and replace t ext " via" line, blogging Viddler v ideos Blip.t v blogs em bedding, blogs Eyespot iFilm Jum pcut present at ions Rev v er Spik e Veoh Viddler Vim eo Yahoo! Vim eo Visit orVille 2nd vlogs VMware

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W ] [ X] [ Y] [ Z ] wat chlist , Wikipedia weat her forecast s web album s feeds, screensaver Flickr Picasa ident it y Picasa, creat ing Picasa, geot agging im ages Picasa, st orage space Web Dat a, Edit Grid web sit es alt ernat ive soft ware browsers, t est ing Canvas, t raffic visualizat ion change det ect ion service chat back cont ent event s, iCal cont ent m anagem ent syst em drag and drop im ages em bedding calendars em bedding dynam ic chart s em bedding m aps em bedding present at ions em bedding spreadsheet s gadget s, adding GeoCit ies Google Cust om Search Engine ( CSE) Google Page Creat or, overview Google Sit es Google Talk gadget Google Web Search im port ing dat a popular post widget prom ot ing wit h gadget s publishing docum ent s as 2nd search engine opt im izat ion ( SEO) t ipping point t racking gadget t raffic user surveys WEEKDAY whit e list , CSS widget s. See also gadget s Blogger chat back em bedding calendars in blogs em bedding m aps Google Analyt ics page loading t im e Rem em ber t he Milk t o- do list Wikipedia Google Reader relat ed web sit es wat chlist wikis Google Groups

    Google Sit es Windows Movie Maker Picasa feed screensaver short cut s, creat ing new docum ent s Wingdings wizard, iGoogle gadget WMV files Word files at t aching t o m ail convert ing t o PDFs word spacing Wor dPr ess

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] XML em bedding calendars in blogs im port ing dat a from web sit es popular post widget program m ing gadget s t racking gadget t raffic t raffic visualizat ion

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] Yahoo! Calendar GeoCit ies Local Maps Mail phot o feeds Pipes 2nd 3rd Video YouTube allowing Flash alt ernat ives chrom eless player color, em bedded videos em bedding m ult iple videos em bedding videos, blogs feeds iGoogle gadget iPhone m obile phones m usic video lyrics offline use present at ions resizing em bedded videos signing up uploading videos vs Google Video

    I n de x [ SYMBOL] [ A] [ B] [ C] [ D] [ E] [ F] [ G] [ H] [ I ] [ J] [ K] [ L] [ M] [ N] [ O] [ P] [ Q] [ R] [ S] [ T] [ U] [ V] [ W] [ X] [ Y] [ Z ] ZI P files, present at ions Zoho