SlideShare a Scribd company logo
1 of 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?

More Related Content

What's hot

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
 
Automating boring tasks with Powershell
Automating boring tasks with PowershellAutomating boring tasks with Powershell
Automating boring tasks with PowershellAlban Gérôme
 
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 GroupEPC Group
 
Awash in a sea of connections
Awash in a sea of connectionsAwash in a sea of connections
Awash in a sea of connectionsGalen Charlton
 
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.Jason Morrison
 
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 RestangularJohn Schmidt
 
Web Scraping is BS
Web Scraping is BSWeb Scraping is BS
Web Scraping is BSJohn D
 
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus BundlesDesymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus BundlesAlbert Jessurum
 

What's hot (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
 

Viewers also liked

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 2013MrDys
 
Freebasing for Fun and Enhancement
Freebasing for Fun and EnhancementFreebasing for Fun and Enhancement
Freebasing for Fun and EnhancementMrDys
 
Improving Catalyst by Reaching Out
Improving Catalyst by Reaching OutImproving Catalyst by Reaching Out
Improving Catalyst by Reaching OutMrDys
 
Mobile Web Interface
Mobile Web InterfaceMobile Web Interface
Mobile Web InterfaceMrDys
 
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 WebsitesMrDys
 
Wishes for the Sky Documentation
Wishes for the Sky DocumentationWishes for the Sky Documentation
Wishes for the Sky DocumentationKathleen Maloney
 
Strategies for Debugging Print CSS
Strategies for Debugging Print CSSStrategies for Debugging Print CSS
Strategies for Debugging Print CSSMrDys
 

Viewers also liked (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
 

Similar to You Either Surf Or You Fight

OpenSocial Intro
OpenSocial IntroOpenSocial Intro
OpenSocial IntroPamela 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 WebPatrick Chanezon
 
Programming For Google Wave
Programming For Google WaveProgramming For Google Wave
Programming For Google WaveRodrigo Borges
 
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 RobotsPatrick Chanezon
 
jQuery Presentation - Refresh Events
jQuery Presentation - Refresh EventsjQuery Presentation - Refresh Events
jQuery Presentation - Refresh EventsEugene Andruszczenko
 
Eugene Andruszczenko: jQuery
Eugene Andruszczenko: jQueryEugene Andruszczenko: jQuery
Eugene Andruszczenko: jQueryRefresh Events
 
Introduction to Jquery
Introduction to JqueryIntroduction to Jquery
Introduction to JqueryAmzad Hossain
 
Introduccion app engine con python
Introduccion app engine con pythonIntroduccion app engine con python
Introduccion app engine con pythonsserrano44
 
Intro to jQuery - LUGOR - Part 1
Intro to jQuery - LUGOR - Part 1Intro to jQuery - LUGOR - Part 1
Intro to jQuery - LUGOR - Part 1Ralph Whitbeck
 
Devfest 09 Building Wave Robots
Devfest 09 Building Wave RobotsDevfest 09 Building Wave Robots
Devfest 09 Building Wave RobotsChris Schalk
 
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 WP7Igor Moochnick
 
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 ChapterTom Johnson
 
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 ChapterTom Johnson
 
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 2015Loïc Knuchel
 
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...Valerie Forrestal
 

Similar to 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...
 

Recently uploaded

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.pdfUK Journal
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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 FresherRemote DBA Services
 
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 productivityPrincipled Technologies
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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 2024Rafal Los
 
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 Scriptwesley chun
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
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...apidays
 
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 2024The Digital Insurer
 

Recently uploaded (20)

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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
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...
 
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
 

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