Access Keys:
Skip to content (Access Key - 0)
My Area (Access Key - 2)


Toggle Sidebar
Your Rating: Results: PatheticBadOKGoodOutstanding! 9 rates
Labels:
aleph aleph Delete
basic basic Delete
javascript javascript Delete
json json Delete
opac opac Delete
api api Delete
spelling spelling Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

OPAC spelling suggestions using Yahoo! webservice JSON (no PHP required)

Tags: , , , , , , Last Updated: Oct 30, 2009 00:57


  • Description

    We can't use PHP, so I've developed this code to read the JSON return from Yahoo! Spelling suggestion service. Suggestions are returned following a search that has 0 hits and then made clickable. However, it could in theory be entered anywhere a search variable is passed.


  • Author: Mark Watmough
  • Additional author(s):
  • Institution: Napier UniversityEdinburgh Napier University
  • Year: 2009
  • License: BSD style
  • Short description: Use, modification and distribution of the code are permitted provided the copyright notice, list of conditions and disclaimer appear in all related material.
  • Link to terms: [Detailed license terms]
  • Skill required for using this code:
    basic

State

Stable - We have had it working on our production server for over 6 months.

Programming language

Javascript

Screen captures

Author(s) homepage

http://nuin.napier.ac.uk

Download

http://www.exlibrisgroup.org/download/attachments/22905672/YahooSpellingSuggestions.txt

Working example

http://nuin.napier.ac.uk/F/?func=find-e&request=library+management+systms&find_scan_code=FIND_WRD.

Installation instructions

  1. Read Yahoo!'s guide and then register for an APPID here -  http://developer.yahoo.com/search/web/V1/spellingSuggestion.html
  2. Copy code attached/below and place in the web files as appropriate (we used find-e-head and find-b-permute head as these are seen after '0' hits are returned for a search)
  3. Replace the <REPLACEME> text (shown below) with your APPID obtained earlier. Also the '<a href=>' will need to be replaced to link to your catalogue.
  4. Restart www_server and test it out!
    Only one suggestion is ever returned. If Yahoo! returns no suggestion, nothing is shown
    Please note: The code above and attached is currently nested in a table.

TO DO list

None...yet.

Known issues

Suggestions are sometimes held on the local cache


Comments

Text...


Page Attachments

File NameCommentSizeNumber of Downloads
YahooSpellingSuggestions.txt1 kB234
Library Catalogue - Permute Search_1239276991668.jpg23 kB892

Added by Mark Watmough on Apr 09, 2009 14:52, last edited by Conf Admin on Oct 30, 2009 00:57

  1. Apr 11, 2009

    Hi Mark

    That's great! I implemented it right away in our test new OPAC.

    I am implementing lots of stuff and as soon as the new OPAC is released I will post to our community. I hope to release an Ipod Touch/Iphone OPAC compatible... It is looking good so far.

    The link to the PC OPAC is the following

    http://iadb.exlibrisgroup.com:8991/F?func=find-b-0&local_base=fhl_new

    If you have any questions I can answer

    Best regards,

    Rodrigo

    1. Apr 14, 2009

      Hi Rodrigo,

      I'm happy to hear that you implemented so quickly! The iPod touch/iPhone compatible OPAC is something that we would be very interested in hearing more about - please keep me posted!

      Thanks,

      Mark.

      1. Apr 15, 2009

        I am just finishing the last adjustments of the ipod/iphone html pages and I will document it before we release to our users. I will create a topic for this here too

        See you Mark

  2. Apr 15, 2009

    Hi Mark,

    thanks a lot for this! What about the other nice features you´ve inplemented in ALEPH?

    Best,

    Timm

  3. Apr 17, 2009

    Hi Mark,

    Thanks! I was just looking into doing it on my own when I decided to check here first : ) I like the JSON idea better than PHP, keeps things simpler.

    I wonder if the 5000 Queries Per Day limit has been a problem? They say 5000/IP/Day...is it the server IP (OPAC) or the client since Javascript is running in the user's browser, I'd guess client but maybe it's based on the App Id.

    One option I was considering was using the Yahoo! Search BOSS service but they plan on charging per query soon which might not work for us.

    > http://developer.yahoo.com/search/boss/fees.html

    > http://tech.groups.yahoo.com/group/ysearchboss/message/1713

    1. Apr 22, 2009

      Hi Anoop,

      Thanks for your comments. No, the 5000 searches per IP limit has not been a problem for us as we only query Yahoo! when a search has returned zero results.

      I think, as you suggest, that it may be per client IP ("Access is rate limited based on the caller's IP address, and queries are limited per IP and per day.") although it certainly isn't very clear.

      Mark.

  4. May 07, 2009

    Hi, Mark

    Thank you for sharing. It's great.
    I can do it well because your clear explanation.
    Thanks a lot.

    Our WebOPAC in Chinese: http://webpac.lib.nthu.edu.tw/
    Our WebOPAC in English: http://webpac.lib.nthu.edu.tw/F?func=find-b-0&local_base=top01&CON_LNG=eng

    Best regards,

    Joe
    Taiwan,  R.O.C.

    1. May 12, 2009

      No problem Joe. I'm pleased you found it easy to implement!

      Best wishes,

      Mark.

  5. Jun 01, 2009

    Did ExLibris remove the http://www.exlibrisgroup.org/download/attachments/22905672/yahooJSON.txt file?

    Might have been a mistake, seems like they've replaced it with an internal doc. Tsk Tsk. : )

    1. Jun 03, 2009

      It looks as though they did :'o(

      I recommend that you copy the code in the 'installation instructions' section rather than try and find the original attachment!

  6. Jul 14, 2009

    Thanks for posting this! It was quick and easy to setup in our OPAC. I made a slight change to retain session IDs, other than that it copy + paste-tastic.

  7. Aug 03, 2009

    Pleased to hear that Thomas!

    Also, I've reattached the document that was written over by ExLibris (See previous comments). This really wasn't a big problem as it is identical to the script in the installation instructions.

Adaptavist Theme Builder Powered by Atlassian Confluence