SlideShare une entreprise Scribd logo
1  sur  27
You Either Surf or You Fight: Integrating Library Services With Google Wave Sean Hannan Sheridan Libraries Johns Hopkins University
Google Wave http://wave.google.com Collaborative platform
Why Library Services there? You can’t always force users to come to you Go where they are
Wave Apps Two types  Gadgets Like existing iGoogle gadgets Robots Real-time interaction Let’s go for the real-time interaction
Already on Wave? Invite uncle-milty@appspot.com to a conversation
Creating a Wave Robot Libraries for Java and Python Deployment using Google AppEngine
App Engine http://appengine.google.com Google’s cloud-computing platform Free for up to 1.3 million requests per day
Set up the Application Create an application at appengine.google.com Set up an application identifier <app>.appspot.com
App Engine SDK Download the App Engine SDK from http://code.google.com/appengine/downloads.html Start the App Engine Launcher and create a new application
Set up the app.yaml application: uncle-milty version: 2 runtime: python api_version: 1 handlers: - url: /_wave/.*   script: uncle-milty.py - url: /assets static_dir: assets
Wave Robot API Download the files from svn: svn checkout http://wave-robot-python-client.googlecode.com/svn/trunk/src/waveapi waveapi Drop it in the application directory
Wave Concepts Wavelet The conversation taking place within Google Wave Blip Every message as part of the wavelet Hierarchical  Each of these have unique identifiers that can be used to programmatically address them
Project Overview A simple chat bot Searches the library catalog for results
Code it up! Available on github: http://github.com/MrDys/uncle-milty
External Libraries External libraries are a-okay Just drop it in the project directory Going to use BeautifulSoup to scrape the OPAC
Imports from waveapi import events from waveapi import model from waveapi import robot from waveapi import document from waveapi.ops import OpBuilder import logging import urllib2 from BeautifulSoup import BeautifulSoup
OnRobotAdded Function def OnRobotAdded(properties, context):   """Invoked when the robot has been added.""" logging.debug("created") root_wavelet = context.GetRootWavelet() root_wavelet.CreateBlip().GetDocument().SetText("Hi, I'm Milton S. Eisenhower and I'd be happy to help you with your research. I will search the JHU catalog for anything that you say to me and I'll let you know if I find anything.")
OnBlip Submitted Function def OnBlipSubmitted(properties, context):   blip = context.GetBlipById(properties['blipId'])   page = urllib2.urlopen("https://catalog.library.jhu.edu/ipac20/ipac.jsp?menu=search&aspect=subtab22&npp=5&ipp=20&spp=20&profile=general&ri=&index=ALTITLE&term=" + blip.GetDocument().GetText() + "&x=0&y=0&aspect=subtab22")
OnBlipSubmitted Function con’t  soup = BeautifulSoup(page)   results = soup.findAll(title="View more information") sub_blip = context.GetRootWavelet().CreateBlip() sub_blipdoc = sub_blip.GetDocument()
OnBlipSumitted Function con’t outputstr = ""   count = 0   for i  in results:     if count >= 5:       break     else: itemstr = str(i) itemstr = itemstr.replace('class="smallBoldAnchor"', '') outputstr = outputstr + itemstr + "<br/>"       count = count + 1
OnBlipSubmitted Function con’t logging.debug(outputstr) sub_blipdoc.SetText(" ")   builder = OpBuilder(context) builder.DocumentAppendMarkup(sub_blip.waveId, sub_blip.waveletId, sub_blip.blipId, outputstr) logging.debug(sub_blip.waveId + " " + sub_blip.waveletId + " " + sub_blip.blipId)
Register Event Handlers if __name__ == '__main__': myRobot = robot.Robot('Milton S. Eisenhower',  image_url='http://uncle-milty.appspot.com/assets/milty.png',       version='2', profile_url='http://uncle-milty.appspot.com/') myRobot.RegisterHandler(events.BLIP_SUBMITTED, OnBlipSubmitted) myRobot.RegisterHandler(events.WAVELET_SELF_ADDED, OnRobotAdded) myRobot.Run()
Gotchas CSS Doesn’t really like it, so keep it simple HTML Links Won’t let you do it directly, must use OpBuilder
Deployment Just hit ‘Deploy’ in the App Engine Launcher
Debugging Use the logging library View the log results in realtime on http://appengine.google.com
What next? Could be improved in a lot of ways More services integrated Create a menu-like system to select options
Q&A Questions?

Contenu connexe

Tendances

Building your API utility belt (Keith Casey)
Building your API utility belt (Keith Casey)Building your API utility belt (Keith Casey)
Building your API utility belt (Keith Casey)
Future Insights
 
PowerShell with SharePoint 2013 and Office 365 - EPC Group
PowerShell with SharePoint 2013 and Office 365 - EPC GroupPowerShell with SharePoint 2013 and Office 365 - EPC Group
PowerShell with SharePoint 2013 and Office 365 - EPC Group
EPC Group
 
Awash in a sea of connections
Awash in a sea of connectionsAwash in a sea of connections
Awash in a sea of connections
Galen Charlton
 
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus BundlesDesymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
Albert Jessurum
 

Tendances (11)

Building your API utility belt (Keith Casey)
Building your API utility belt (Keith Casey)Building your API utility belt (Keith Casey)
Building your API utility belt (Keith Casey)
 
Automating boring tasks with Powershell
Automating boring tasks with PowershellAutomating boring tasks with Powershell
Automating boring tasks with Powershell
 
PowerShell with SharePoint 2013 and Office 365 - EPC Group
PowerShell with SharePoint 2013 and Office 365 - EPC GroupPowerShell with SharePoint 2013 and Office 365 - EPC Group
PowerShell with SharePoint 2013 and Office 365 - EPC Group
 
Awash in a sea of connections
Awash in a sea of connectionsAwash in a sea of connections
Awash in a sea of connections
 
Clearance: Simple, complete Ruby web app authentication.
Clearance: Simple, complete Ruby web app authentication.Clearance: Simple, complete Ruby web app authentication.
Clearance: Simple, complete Ruby web app authentication.
 
Consume RESTful APIs with $resource and Restangular
Consume RESTful APIs with $resource and RestangularConsume RESTful APIs with $resource and Restangular
Consume RESTful APIs with $resource and Restangular
 
Web Scraping is BS
Web Scraping is BSWeb Scraping is BS
Web Scraping is BS
 
Web Scraping
Web ScrapingWeb Scraping
Web Scraping
 
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus BundlesDesymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
 
Voluminous_Weibo
Voluminous_WeiboVoluminous_Weibo
Voluminous_Weibo
 
21.search in laravel
21.search in laravel21.search in laravel
21.search in laravel
 

En vedette (7)

This is how you do digital collections in 2013
This is how you do digital collections in 2013This is how you do digital collections in 2013
This is how you do digital collections in 2013
 
Freebasing for Fun and Enhancement
Freebasing for Fun and EnhancementFreebasing for Fun and Enhancement
Freebasing for Fun and Enhancement
 
Improving Catalyst by Reaching Out
Improving Catalyst by Reaching OutImproving Catalyst by Reaching Out
Improving Catalyst by Reaching Out
 
Mobile Web Interface
Mobile Web InterfaceMobile Web Interface
Mobile Web Interface
 
Let's Get Small: A Microservices Approach to Library Websites
Let's Get Small: A Microservices Approach to Library WebsitesLet's Get Small: A Microservices Approach to Library Websites
Let's Get Small: A Microservices Approach to Library Websites
 
Wishes for the Sky Documentation
Wishes for the Sky DocumentationWishes for the Sky Documentation
Wishes for the Sky Documentation
 
Strategies for Debugging Print CSS
Strategies for Debugging Print CSSStrategies for Debugging Print CSS
Strategies for Debugging Print CSS
 

Similaire à You Either Surf Or You Fight

OpenSocial Intro
OpenSocial IntroOpenSocial Intro
OpenSocial Intro
Pamela Fox
 
Jaoo - Open Social A Standard For The Social Web
Jaoo - Open Social A Standard For The Social WebJaoo - Open Social A Standard For The Social Web
Jaoo - Open Social A Standard For The Social Web
Patrick Chanezon
 
Intro to jQuery - LUGOR - Part 1
Intro to jQuery - LUGOR - Part 1Intro to jQuery - LUGOR - Part 1
Intro to jQuery - LUGOR - Part 1
Ralph Whitbeck
 
Caliburn.micro jump start composite applications for WPF, Silverlight and WP7
Caliburn.micro jump start composite applications for WPF, Silverlight and WP7Caliburn.micro jump start composite applications for WPF, Silverlight and WP7
Caliburn.micro jump start composite applications for WPF, Silverlight and WP7
Igor Moochnick
 

Similaire à You Either Surf Or You Fight (20)

Yahoo is open to developers
Yahoo is open to developersYahoo is open to developers
Yahoo is open to developers
 
OpenSocial Intro
OpenSocial IntroOpenSocial Intro
OpenSocial Intro
 
Jaoo - Open Social A Standard For The Social Web
Jaoo - Open Social A Standard For The Social WebJaoo - Open Social A Standard For The Social Web
Jaoo - Open Social A Standard For The Social Web
 
jQuery for web development
jQuery for web developmentjQuery for web development
jQuery for web development
 
Programming For Google Wave
Programming For Google WaveProgramming For Google Wave
Programming For Google Wave
 
Google Devfest 2009 Argentina - Building Google Wave Robots
Google Devfest 2009 Argentina - Building Google Wave RobotsGoogle Devfest 2009 Argentina - Building Google Wave Robots
Google Devfest 2009 Argentina - Building Google Wave Robots
 
jQuery Presentation - Refresh Events
jQuery Presentation - Refresh EventsjQuery Presentation - Refresh Events
jQuery Presentation - Refresh Events
 
Eugene Andruszczenko: jQuery
Eugene Andruszczenko: jQueryEugene Andruszczenko: jQuery
Eugene Andruszczenko: jQuery
 
Introduction to Jquery
Introduction to JqueryIntroduction to Jquery
Introduction to Jquery
 
Introduccion app engine con python
Introduccion app engine con pythonIntroduccion app engine con python
Introduccion app engine con python
 
Open social
Open socialOpen social
Open social
 
Intro to jQuery - LUGOR - Part 1
Intro to jQuery - LUGOR - Part 1Intro to jQuery - LUGOR - Part 1
Intro to jQuery - LUGOR - Part 1
 
Devfest 09 Building Wave Robots
Devfest 09 Building Wave RobotsDevfest 09 Building Wave Robots
Devfest 09 Building Wave Robots
 
Walter api
Walter apiWalter api
Walter api
 
jQuery
jQueryjQuery
jQuery
 
Caliburn.micro jump start composite applications for WPF, Silverlight and WP7
Caliburn.micro jump start composite applications for WPF, Silverlight and WP7Caliburn.micro jump start composite applications for WPF, Silverlight and WP7
Caliburn.micro jump start composite applications for WPF, Silverlight and WP7
 
API Documentation presentation to East Bay STC Chapter
API Documentation presentation to East Bay STC ChapterAPI Documentation presentation to East Bay STC Chapter
API Documentation presentation to East Bay STC Chapter
 
API Documentation -- Presentation to East Bay STC Chapter
API Documentation -- Presentation to East Bay STC ChapterAPI Documentation -- Presentation to East Bay STC Chapter
API Documentation -- Presentation to East Bay STC Chapter
 
Ionic bbl le 19 février 2015
Ionic bbl le 19 février 2015Ionic bbl le 19 février 2015
Ionic bbl le 19 février 2015
 
Bridging the gap from Wikipedia to scholarly sources: a simple discovery solu...
Bridging the gap from Wikipedia to scholarly sources: a simple discovery solu...Bridging the gap from Wikipedia to scholarly sources: a simple discovery solu...
Bridging the gap from Wikipedia to scholarly sources: a simple discovery solu...
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

You Either Surf Or You Fight

  • 1. You Either Surf or You Fight: Integrating Library Services With Google Wave Sean Hannan Sheridan Libraries Johns Hopkins University
  • 2. Google Wave http://wave.google.com Collaborative platform
  • 3. Why Library Services there? You can’t always force users to come to you Go where they are
  • 4. Wave Apps Two types Gadgets Like existing iGoogle gadgets Robots Real-time interaction Let’s go for the real-time interaction
  • 5. Already on Wave? Invite uncle-milty@appspot.com to a conversation
  • 6. Creating a Wave Robot Libraries for Java and Python Deployment using Google AppEngine
  • 7. App Engine http://appengine.google.com Google’s cloud-computing platform Free for up to 1.3 million requests per day
  • 8. Set up the Application Create an application at appengine.google.com Set up an application identifier <app>.appspot.com
  • 9. App Engine SDK Download the App Engine SDK from http://code.google.com/appengine/downloads.html Start the App Engine Launcher and create a new application
  • 10. Set up the app.yaml application: uncle-milty version: 2 runtime: python api_version: 1 handlers: - url: /_wave/.* script: uncle-milty.py - url: /assets static_dir: assets
  • 11. Wave Robot API Download the files from svn: svn checkout http://wave-robot-python-client.googlecode.com/svn/trunk/src/waveapi waveapi Drop it in the application directory
  • 12. Wave Concepts Wavelet The conversation taking place within Google Wave Blip Every message as part of the wavelet Hierarchical Each of these have unique identifiers that can be used to programmatically address them
  • 13. Project Overview A simple chat bot Searches the library catalog for results
  • 14. Code it up! Available on github: http://github.com/MrDys/uncle-milty
  • 15. External Libraries External libraries are a-okay Just drop it in the project directory Going to use BeautifulSoup to scrape the OPAC
  • 16. Imports from waveapi import events from waveapi import model from waveapi import robot from waveapi import document from waveapi.ops import OpBuilder import logging import urllib2 from BeautifulSoup import BeautifulSoup
  • 17. OnRobotAdded Function def OnRobotAdded(properties, context): """Invoked when the robot has been added.""" logging.debug("created") root_wavelet = context.GetRootWavelet() root_wavelet.CreateBlip().GetDocument().SetText("Hi, I'm Milton S. Eisenhower and I'd be happy to help you with your research. I will search the JHU catalog for anything that you say to me and I'll let you know if I find anything.")
  • 18. OnBlip Submitted Function def OnBlipSubmitted(properties, context): blip = context.GetBlipById(properties['blipId']) page = urllib2.urlopen("https://catalog.library.jhu.edu/ipac20/ipac.jsp?menu=search&aspect=subtab22&npp=5&ipp=20&spp=20&profile=general&ri=&index=ALTITLE&term=" + blip.GetDocument().GetText() + "&x=0&y=0&aspect=subtab22")
  • 19. OnBlipSubmitted Function con’t soup = BeautifulSoup(page) results = soup.findAll(title="View more information") sub_blip = context.GetRootWavelet().CreateBlip() sub_blipdoc = sub_blip.GetDocument()
  • 20. OnBlipSumitted Function con’t outputstr = "" count = 0 for i in results: if count >= 5: break else: itemstr = str(i) itemstr = itemstr.replace('class="smallBoldAnchor"', '') outputstr = outputstr + itemstr + "<br/>" count = count + 1
  • 21. OnBlipSubmitted Function con’t logging.debug(outputstr) sub_blipdoc.SetText(" ") builder = OpBuilder(context) builder.DocumentAppendMarkup(sub_blip.waveId, sub_blip.waveletId, sub_blip.blipId, outputstr) logging.debug(sub_blip.waveId + " " + sub_blip.waveletId + " " + sub_blip.blipId)
  • 22. Register Event Handlers if __name__ == '__main__': myRobot = robot.Robot('Milton S. Eisenhower', image_url='http://uncle-milty.appspot.com/assets/milty.png', version='2', profile_url='http://uncle-milty.appspot.com/') myRobot.RegisterHandler(events.BLIP_SUBMITTED, OnBlipSubmitted) myRobot.RegisterHandler(events.WAVELET_SELF_ADDED, OnRobotAdded) myRobot.Run()
  • 23. Gotchas CSS Doesn’t really like it, so keep it simple HTML Links Won’t let you do it directly, must use OpBuilder
  • 24. Deployment Just hit ‘Deploy’ in the App Engine Launcher
  • 25. Debugging Use the logging library View the log results in realtime on http://appengine.google.com
  • 26. What next? Could be improved in a lot of ways More services integrated Create a menu-like system to select options