Tải bản đầy đủ - 0 (trang)
Hack 134. Promote Your Site Using Google Gadgets

Hack 134. Promote Your Site Using Google Gadgets

Tải bản đầy đủ - 0trang

personal,andit'sworst—atleastfrommyperspective,mileage

ofotherbloggersmayvary—tojustsendoutatraditionalpress

release.HereisanexampleofamailIwouldconsider

particularlyineffective,andI'llexplainthereasonsafter:

CodeView:

Hello,



Wewouldliketoinformyouofournewvirtualrealityexperien

latestinAJAXsoftware,socialcontent,andmobilephonemanag

releasednextweek.UsingHORS-O-RACE,a3MBdesktopprogramfo

gladtoprovideyouatrialversionifyouareinterested,user

themselvesinreal-timeracetrackinginformationviaourspeci

goggleswhich...

























Theemailwillgoonatgreatlength,butyougettheidea.What

waswrongwithit?

Thegreetingisn'tpersonal,asitdoesn'tincludethe

blogger'sname.Thismakesitmorelikelythattheblogger

willconsideritabulkmail,andhitthespambutton.

Thepromotionputstechnologybeforecontentoruse,

suggestingthatwhattheapplicationdeliversmaybeless

interestingthanhowitdeliversit...andifthatisthecase,

itwillprobablybeboringtoendusers.

Themessageisobfuscatedbybuzzwords,makingitharder

forthebloggertounderstanditinthetimeframedevoted

toreadingthemail.

Thetoolofferedrequiresaninstallation,whichmeans

additionaldownloadtime,andworse,exposestheblogger's

systemtorisks(likeavirus,orauto-updatingsoftwarethat

consumessystemresourceandbandwidth).

Thetoolispaid,andincludesdependencies—theHORS-O-



RACEgoggleshardware—whichmaymakethishardfor

users,whothebloggerwritesfor,totry(notwithstanding

theproblemthatHORS-O-RACEisasofyetunreleased

anyway).

Lastnotleast,theemaildoesnotincludeallthenecessary

informationforthebloggertostartwritingareviewabout

thisrightaway,shouldtheydecidetodoso,asthetrial

versionwasnotincludedwithinthefirstmail.

Hereisamuchbetterversionofthatmail.Bloggerslovetoget

tipsandcontent,sothereisnoneedtobeataroundthebush

bywritingeloquentpitches—thebloggerwillappreciatethat

yousentarelevanttip,helpingtoprovidecontent!

CodeView:

HelloJim,



WejustreleasedourHORS-O-RACEwebappforuserstogetthel

information.It'sliveathttp://example.com/horse-or-race.html

acoupleofscreenshotsexclusiveforyou,andhopethisissom

HorseRaceBlogger.example.comcommunity.

Best,

...

























Thistime,thegreetingwaspersonal.Thistime,you'vedirectly

explainedwhatthetooldoes,andprovidedapubliclinktoa

demo.Attachedtothemailareacoupleofexclusive

screenshots,valuabletoanybloggerwhosuspectsthatthe

samemailmighthavebeensenttoadozenotherbloggers

(makingtheblogamereechochamberifit'sposted).The

sentencewithanexplicitreferencetotheHorseRaceBlogger

community,ontheotherhand,isonemoresignalthatthismail



waspreparedbyanactualpersonknowingtherecipient,nota

spambot.



Thegoal:amostpopularpostswidget



Hack135.RollYourOwnAnalyticsAPI

fora"MostPopularPosts"Widget

NoGoogleAnalyticsAPI?Noproblem!

Ifyou'relikeme,youhaveabloganduseGoogleAnalyticsto

trackvisitoractivity.Also,youmightwanta"MostPopular

Posts"sectiononyourblog,showninFigure12-9,asit'sa

greatwayfornewvisitorstofindyourbestcontent.Theonly

problemisthatthiswouldusuallyhavetobehard-coded,and

wouldthereforeneedupdatingperiodicallyafteryou'vechecked

theTopContentreportinGoogleAnalytics,oritwouldrequire

someserver-sidescriptingandadatabasetotrackyourpage

viewsandshowthelinksdynamically.

Wouldn'titbegreatifyoucouldsomehowuseGoogleAnalytics

todisplaythe"MostPopularPosts"sectiononyourblog

automatically?Thatwouldbeahugetime-saverforyouand

wouldmakeitmuchmoreusefulforyourvisitors,asitwould

alwaysbeup-to-date.Unfortunately,GoogleAnalyticsdoesn't

haveanAPIforthatatthetimeofthiswriting(there'sthe

AnalyticstrackersnippetAPI,butit'sforanotherpurpose).But

here'samethodthatdoesn'tinvolveanyserver-sidecodeor

screen-scraping.Allyouneedtodoisuseafewexistingfree

servicesfromGoogleandYahoo!andabitofJavaScript.

Thehackusedherewillmakesomeofyour

Analyticsdatapublic,atrade-offyoumayormay

notwant;detailsareexplainedfurthershortly.

BasicMethod

1. Obtainthetrackingdatainausableformat.Wecan

scheduleGoogleAnalyticstoemailthisasanXMLfileona

regularbasis.

2. MaketheXMLfileaccessibleonline.Byemailingan



attachmenttoGoogleGroups(http://groups.google.com),

thefileisautomaticallygivenapublicURL.

3. WorkouttheURLofthemostrecentreport.AsGoogle

GroupsprovidesRSS/Atomfeedsforallmessages,wecan

easilyfindtheURLofthemostrecentmessageand

thereforeworkouttheURLoftheXMLreport.

4. Preparethedataforuse.Youneedtomanipulatethe

XMLandmassageitintoahandyJSON(JavaScriptObject

Notation)formatthatyoucanuseonyourblog,whichcan

allbedoneusingYahoo!Pipes[Hack#126].

5. Displaythelinksonyoursite.WithjustabitofclientsideJavaScript,youcanfinallyaddaself-updating"Most

PopularPosts"sectiontoyourblog.

Thereyouhaveit!UsingyourownGoogleAnalyticsdata,you

cancreateacompletelyautomatedwayofdisplayingyourmost

popularpoststoyoursitevisitors.

Ifyou'reinterestedinexactlyhowIdidthis,therestofthis

hackexpandsoneachstepandtakesyouthroughtheentire

process.

SettingUptheGoogleGroup

BecauseGoogleAnalyticsdoesn'tprovideanAPI,orallowyou

tolinkdirectlytoanyexportedreports,youcanuseaGoogle

Grouptohostthefiles,whichyou'llscheduleGoogleAnalytics

toemailtoyou.

WhenyousetupyourGoogleGroup,choosethe

Announcement-onlyoption.Oncecreated,underthe"Group

settings"menuitem,selectAccessandmakesurethatthe

followingarechecked:

Anybodycanviewgroupcontent.Althoughitwouldbe

preferentialtomakethegroupprivate,thatwouldprevent

publicaccesstothefeedsforthegroup,whichyou'llneedlater.



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Hack 134. Promote Your Site Using Google Gadgets

Tải bản đầy đủ ngay(0 tr)

×