Building a Custom Data Service Tutorial

Embed Size (px)

Citation preview

  • 8/13/2019 Building a Custom Data Service Tutorial

    1/24

    SEARCHMONKEY APPLICATION

    How to make a CUSTOM DATA SERVICE for use wit a!I!fo"ar #usi!$ %Pater&

  • 8/13/2019 Building a Custom Data Service Tutorial

    2/24

    OVERVIEW

    SearchMonkey apps can display content scraped from almost anypage on the internet.

    Using a programming language called S!"# this tutorial $ill teachyou ho$ to create a %custom data ser&ice' $hich $ill feed content

    to the SearchMonkey apps you $ill learn to create in the ne(ttutorial.

    )on*t $orry# this sounds more technically comple( than it actuallyis+ You 'o!(t !ee' to k!ow %SLT )o'eto get your ,ustom )ata

    Ser&ice up and running# thanks to the good people $ho made the$onderful -ather irefo( /dd0on.

    http://en.wikipedia.org/wiki/Xslthttp://en.wikipedia.org/wiki/Xslt
  • 8/13/2019 Building a Custom Data Service Tutorial

    3/24

    ,ustom )ata Ser&ice 1 "o Start2

    3. )o$nload %Pater# the irefo( /dd0onhttps244addons.mo5illa.org4en0US4firefo(4addon43367

    "his e(tension $ill help you to 8uickly and easily gra9 the S!" code

    from a $e9page and paste that code into your ,ustom )ata Ser&ice

    7. :o to http244de&eloper.yahoo.com4searchmonkey4

    and ,lick on %;uild an /pp'.

  • 8/13/2019 Building a Custom Data Service Tutorial

    4/24

    ;uilding your ,ustom )ata Ser&ice

    Step 32 *asi) I!fo

    3. :i&e your )ata Ser&ice a nicename.

    7. Select %-age' for "ype.

    . /gree to the "erms of Ser&ice."hanks for 9eing agreea9le.

    ?. ,lick =E" and you should 9emagically transported to theUR!s page.

  • 8/13/2019 Building a Custom Data Service Tutorial

    5/24

    URLs + Tri$$er URL Patter! O,er,iew

    A !ote o! ma i!$ a Tri$$er URL Patter!-

    "rigger UR! patterns are simply the root url ofany page# minus the 9eginning portion.

    or e(ample# if you $anted to e(tractinformation from the -itchforkmedia.com/l9um Re&ie$ pages# you $ould go to2http244$$$.pitchforkmedia.com4article4record.

    rom this UR! you $ould remo&e http244$$$and the page name# so that you are left $iththe root2.pitchforkmedia.com4article4record@re&ie$4A

    If# on the other hand# you $anted to pullcontent from -itchfork*s feature stories# your%"rigger UR! -attern' $ould look more likethis2 pitchforkmedia.com4article4feature4A.

    ;ecause -itchfork keeps features in thatfolder# as you can see from this feature2http244$$$.pitchforkmedia.com4article4featur

    http://www.pitchforkmedia.com/article/record_review/142254-broken-social-scene-presents-brendan-canning-something-for-all-of-ushttp://www/http://www.pitchforkmedia.com/article/feature/142392-pitchfork-music-festival-2008-sundayhttp://www.pitchforkmedia.com/article/feature/142392-pitchfork-music-festival-2008-sundayhttp://www.pitchforkmedia.com/article/feature/http://www.pitchforkmedia.com/article/record_review/http://www/http://www.pitchforkmedia.com/article/record_review/142254-broken-social-scene-presents-brendan-canning-something-for-all-of-us
  • 8/13/2019 Building a Custom Data Service Tutorial

    6/24

    ;uilding your ,ustom )ata Ser&ice

    Step 72 URLs

    3. or the tutorial# $e $ill 9e e(tracting datafrom http244$$$.do$nload.com4

    Enter ./'ow!0oa'/)om1.as the TriggerURL Pattern.

    . ,lick =E" and you should 9e magicallytransported to the )ata E(traction pageH

    http://www.download.com/http://www.download.com/Trillian/3000-2150_4-10047473.htmlhttp://www.download.com/Trillian/3000-2150_4-10047473.htmlhttp://www.download.com/
  • 8/13/2019 Building a Custom Data Service Tutorial

    7/24

    ;uilding your ,ustom )ata Ser&ice

    Step

  • 8/13/2019 Building a Custom Data Service Tutorial

    8/24

    ;uilding your ,ustom )ata Ser&iceStep . ,opy the %-ath' at the top Fhighlighted in a lo&elyyello$G

    ?. -aste that -ath into the )ata E(traction page in the)ash9oard so that you end up $ith thisH

    http://www.download.com/Trillian/3000-2150-10047473.htmlhttp://www.download.com/Trillian/3000-2150-10047473.html
  • 8/13/2019 Building a Custom Data Service Tutorial

    9/24

    ;uilding your ,ustom )ata Ser&iceStep

  • 8/13/2019 Building a Custom Data Service Tutorial

    10/24

    ;uilding your ,ustom )ata Ser&iceStep F1'i,@i'B3u"0iserDes)F1'i,1a@7F1im$1sr)J 1

    ;ut ho$ WellH

  • 8/13/2019 Building a Custom Data Service Tutorial

    11/24

    ;uilding your ,ustom )ata Ser&iceStep 1from the 9eginning. So youre left $ith2

    'i,@i'Br""o'>ra3F1'i,@i'Br"se00F1'i,@i'Br")o!te!tF1'i,@i'B)o!te!tMai!F1'i,@i'B)o!te!t*o'>F1'i,@i'B3u"0iserDes)F1'i,1a@7F1im$

    =e(t# add 1sr)to the end of the line. =O"E2 If you $ere e(tracting a link# youd add 1ref. /nd forte(t# add nothing.

    'i,@i'Br""o'>ra3F1'i,@i'Br"se00F1'i,@i'Br")o!te!tF1'i,@i'B)o!te!tMai!F1'i,@i'B)o!te!t*o'>F1'i,@i'B3u"0iserDes)F1'i,1a@7F1im$1sr)

    Lou*re e(tracting a picture# so replace that 'i, near the 9eginning of the line $ith an asterisk F.&. =O"E2or te(t and links# lea&e it as 'i,.

    .@i'Br""o'>ra3F1'i,@i'Br"se00F1'i,@i'Br")o!te!tF1'i,@i'B)o!te!tMai!F1'i,@i'B)o!te!t*o'>F1'i,@i'B3u"0iserDes)F1'i,1a@7F1im$1sr)J 1

  • 8/13/2019 Building a Custom Data Service Tutorial

    12/24

    ;uilding your ,ustom )ata Ser&iceStep . =e(t# enclose your line of code $ith resour)eB11 at the 9eginning# and J 1 at the end FRemem9er to put a space 9et$een the end 8uote and 9ackslashG. =o$# your code should look like this2

    resour)eB11.@i'Br""o'>ra3F1'i,@i'Br"se00F1'i,@i'Br")o!te!tF1'i,@i'B)o!te!tMai!F1'i,@i'B)o!te!t*o'>F1'i,@i

    'B3u"0iserDes)F1'i,1a@7F1im$1sr)J 1

    ?. "hen# gi&e it a name tag at the 9eginning of the line. "he name is for youruse only to descri9e $hat you ha&e e(tracted. Im going to call this dataresource PphotoP 9y adding Gmeta re0Bre0-3oto and then a space. So yourfinished product should look like this2

    Gmeta re0Bre0-3otoresour)eB11.@i'Br""o'>ra3F1'i,@i'Br"se00F1'i,@i'Br")o!te!tF1'i,@i'B)o!te!tMai!F1'i,@i'B)o!te!t*o'>F1'i,@i'B3u"0iserDes)F1'i,1a@7F1im$1sr)J 1

    =O"E2 If you $ere e(tracting a link# youd add Gitem re0at the 9eginning.

  • 8/13/2019 Building a Custom Data Service Tutorial

    13/24

    ;uilding your ,ustom )ata Ser&iceStep

  • 8/13/2019 Building a Custom Data Service Tutorial

    14/24

    ;uilding your ,ustom )ata Ser&iceStep

  • 8/13/2019 Building a Custom Data Service Tutorial

    15/24

    ;uilding your ,ustom )ata Ser&iceStep

  • 8/13/2019 Building a Custom Data Service Tutorial

    16/24

    ;uilding your ,ustom )ata Ser&iceStep F1'i,@i'B3u"0iserDes)F13@7FJ 1

  • 8/13/2019 Building a Custom Data Service Tutorial

    17/24

    ;uilding your ,ustom )ata Ser&iceStep 1from the 9eginning. So youre left $ith2

    'i,@i'Br""o'>ra3F1'i,@i'Br"se00F1'i,@i'Br")o!te!tF1'i,@i'B)o!te!tMai!F1'i,@i'B)o!te!t*o'>F1'i,@i'B3u"0iserDes)F13@7F

    "hen# enclose your line of code $ith resour)eB11 at the 9eginning# and J 1 at the end Fremem9er to

    include a space 9et$een the end 8uote and the 9ack slashG. =o$# your code should look like this2

    resour)eB11'i,@i'Br""o'>ra3F1'i,@i'Br"se00F1'i,@i'Br")o!te!tF1'i,@i'B)o!te!tMai!F1'i,@i'B)o!te!t*o'>F1'i,@i'B3u"0iserDes)F13@7FJ 1

    =O"E2 We are e(tracting te(t# so $ere going to lea&e that 'i,near the 9eginning of the line. If $e $ere e(tractinga picture# $e $ould replace that 'i, $ith an asterisk ..

  • 8/13/2019 Building a Custom Data Service Tutorial

    18/24

    ;uilding your ,ustom )ata Ser&iceStep . Lour finished product should look like this2

    Gmeta re0Bre0-te2t resour)eB11'i,@i'Br""o'>ra3F1

    'i,@i'Br"se00F1'i,@i'Br")o!te!tF1'i,@i'B)o!te!tMai!F1'i,@i'B)o!te!t*o'>F1'i,@i'B3u"0iserDes)F13@7FJ 1

    ?. =o$ click Sa&e Refresh# and no$ the lo$er $indo$ panel should look Dust like this2

    YAY< Ne2t- E2tra)ti!$ Li!ks?

  • 8/13/2019 Building a Custom Data Service Tutorial

    19/24

    ;uilding your ,ustom )ata Ser&iceStep

  • 8/13/2019 Building a Custom Data Service Tutorial

    20/24

    ;uilding your ,ustom )ata Ser&iceStep . ,opy the te(t from the -ath 9o(Fhighlighted a9o&e in a !OVE!L yello$G.

    ?. -aste that 9elo$ the picture and te(t code inyour )ata E(traction page in the SearchMonkey /pplication )ash9oard

    so that it looks like this

    )one and done+ =o$ youre ready for the ne(tpartH"$eaking the -ath

  • 8/13/2019 Building a Custom Data Service Tutorial

    21/24

    ;uilding your ,ustom )ata Ser&iceStep ra3F1'i,@i'Br"se00F1'i,@i'Br")o!te!tF1'i,@i'B)o!te!tMai!F1'i,@i'B

    )o!te!t*o'>F1'i,@i'B'0NowF1a@6F

    ;ut you really $ant this2

    Gitem re0Bre0-0i!k

    resour)eB11'i,@i'Br""o'>ra3F1'i,@i'Br"se00F1'i,@i'Br")o!te!tF1'i,@i'B)o!te!tMai!F1'i,@i'B)o!te!t*o'>F1'i,@i'B'0NowF1a@6F1refJ 1

    What*re ya gonna do

  • 8/13/2019 Building a Custom Data Service Tutorial

    22/24

    ;uilding your ,ustom )ata Ser&iceStep ra3F1'i,@i'Br"se00F1'i,@i'Br")o!te!tF1'i,@i'B)o!te!tMai!F1'i,@i'B)o!te!t*o'>F1'i,@i'B'0NowF1a@6F

    E!)0ose >our )o'e wit resource="{// at te "e$i!!i!$= a!'/@href}" /> at te e!'/

    resour)eB11'i,@i'Br""o'>ra3F1'i,@i'Br"se00F1'i,@i'Br")o!te!tF1'i,@i'B)o!te!tMai!F1'i,@i'B)o!te!t*o'>F1'i,@i'B'0NowF1a@6F 1refJ 1

    =O"E2 ;ecause this is a link# youre adding an ref to this code. If this $as a picture# you $ould add an sr)#

    and you $ere gra99ing te(t# you $ould add nothing.

    i,e >our 'ata resour)e a !ame "> a''i!$

  • 8/13/2019 Building a Custom Data Service Tutorial

    23/24

    ;uilding your ,ustom )ata Ser&iceStep

  • 8/13/2019 Building a Custom Data Service Tutorial

    24/24

    ;uilding your ,ustom )ata Ser&iceStep >2 Co!firmatio!

    "he hardest part is o&er. =o$ that you ha&e e(tracted datayou can arrange it into a SearchMonkey /pp 9y Creati!$ aPrese!tatio! A330i)atio!

    "o get started# click on the P,reate a ne$ -resentation/pplicationP link from the confirmation page.

    =ote2 Lou can also create the -resentation /pp at a later date9y going to the )e&eloper "ool ome page# clicking on

    %,reate an /pp' and choosing %,reate a ne$ /pplication'under -resentation /pplications.

    http://developer.search.yahoo.com/http://developer.search.yahoo.com/