SlideShare a Scribd company logo
1 of 25
@sfusgs Geo-tweet my quake… @ayman • yahoo! research http://en.wikipedia.org/wiki/File:San_francisco_1906_earthquake.jpg
Zync • Y! Messenger
FireEagle
FireEagle @ayman
http://bit.ly/statler
shake and rumble in 2GA
http://earthquake.usgs.gov/earthquakes/recenteqsus/Quakes/nc71336726.php
Click through maps…
A Want Ad
USGS lists every quake
http://earthquake.usgs.gov/earthquakes/catalogs/
http://earthquake.usgs.gov/earthquakes/catalogs/
Trust me, it is just XML
Yahoo! Search goes to YDN
Google Search goes to YDN
Bing goes to YDN
Using ElementTree
The flow was simple CRON this:: cUrl XML feed from USGS find local quakes bit.ly the quake permalink if not duplicate record this quake tweet this quake
def fetch_quakes(): def fetch_quakes(): api = bitly.Api(login=’ABCDEF', apikey=’12345678901234567890') rss = parse(urllib.urlopen(USGS_URL)).getroot()     quakes = []     for element in rss.findall('{%s}entry' % USGS_NS):         title = element.findtext('{%s}title' % USGS_NS)        if (title.find("San Francisco Bay") > -1):             point = element.findtext('{%s}point' % GEORSS_NS)             points = point.split(None, 1)             link = element.find('{%s}link' % USGS_NS) href = 'http://earthquakes.usgs.gov%s' % link.get('href') href = api.shorten(href)           if (is_duplicate(href) is False): f = open(‘urls.txt', 'a') f.write('%s' % href) f.close()                 summary = element.findtext('{%s}summary' % USGS_NS)                 summary = summary.split("<br>")[1]                 summary = summary.replace(' at epicenter</p><p>', ' ')                 summary = strip_tags(summary) quakes.append({'title': element.findtext('{%s}title' % USGS_NS),                                'link' : href,                                'updated' : element.findtext('{%s}updated' % USGS_NS),                                'long' : points[1],                                'lat' : points[0],                                'elev' : element.findtext('{%s}elev' % GEORSS_NS),                                'summary' : summary})     return quakes
def is_duplicate(url): def is_duplicate(url):     from subprocess import call if(os.path.exists(‘urls.txt') is False):         call(['/usr/bin/touch', ‘urls.txt']) r = call(['/bin/fgrep', url,               ‘urls.txt'])     if (r == 0):         return True     else:         return False
def send_tweet(t): def send_tweet(t):     import httplib2     username = ’ABCDEFG'     password = ’12345678901234567890' msg = ('%s %s %s' % (t['title'], t['link'], t['summary']))     http = httplib2.Http() http.add_credentials(username, password)     response = http.request(         "http://twitter.com/statuses/update.xml",         "POST", urllib.urlencode({"status": msg,                            "lat": t['lat'],                            "long": t['long']})     ) SEE: http://code.google.com/p/httplib2/ ps: you shouldn’t store your passwords like that…this is just an illustration
fin
Crunched
USGS on Open Gov’t
Open Questions? How can other local sources be disseminated? How can mass media be filtered so it can be consumed in a similar manner? Can we collect information around the news? For example, find all the tweets that relate to a particular quake. Thanks, @ayman.

More Related Content

What's hot

20 modules i haven't yet talked about
20 modules i haven't yet talked about20 modules i haven't yet talked about
20 modules i haven't yet talked aboutTatsuhiko Miyagawa
 
Webmontag Berlin "coffee script"
Webmontag Berlin "coffee script"Webmontag Berlin "coffee script"
Webmontag Berlin "coffee script"Webmontag Berlin
 
Perlのsmart match演算子
Perlのsmart match演算子Perlのsmart match演算子
Perlのsmart match演算子ast_j
 
Robert Murdock Band Brings 60s back to S.A. (The Suburban)
Robert Murdock Band Brings 60s back to S.A. (The Suburban)Robert Murdock Band Brings 60s back to S.A. (The Suburban)
Robert Murdock Band Brings 60s back to S.A. (The Suburban)Jacqueline Durett
 
Building Your First Widget
Building Your First WidgetBuilding Your First Widget
Building Your First WidgetChris Wilcoxson
 
The Joy of Smartmatch
The Joy of SmartmatchThe Joy of Smartmatch
The Joy of SmartmatchAndrew Shitov
 
Simulating Artificial Muscles for Controlling a Robotic Arm with Fluctuation
Simulating Artificial Muscles for Controlling a Robotic Arm with FluctuationSimulating Artificial Muscles for Controlling a Robotic Arm with Fluctuation
Simulating Artificial Muscles for Controlling a Robotic Arm with FluctuationMax Braun
 
LAMP_TRAINING_SESSION_1
LAMP_TRAINING_SESSION_1LAMP_TRAINING_SESSION_1
LAMP_TRAINING_SESSION_1umapst
 
pt-query-digest は Perl!!
pt-query-digest は Perl!!pt-query-digest は Perl!!
pt-query-digest は Perl!!Takafumi ONAKA
 
FrontendLab: Programming UI with FRP and Bacon js - Вячеслав Ворончук
FrontendLab: Programming UI with FRP and Bacon js - Вячеслав ВорончукFrontendLab: Programming UI with FRP and Bacon js - Вячеслав Ворончук
FrontendLab: Programming UI with FRP and Bacon js - Вячеслав ВорончукGeeksLab Odessa
 
PerlでWeb API入門
PerlでWeb API入門PerlでWeb API入門
PerlでWeb API入門Yusuke Wada
 

What's hot (12)

20 modules i haven't yet talked about
20 modules i haven't yet talked about20 modules i haven't yet talked about
20 modules i haven't yet talked about
 
Webmontag Berlin "coffee script"
Webmontag Berlin "coffee script"Webmontag Berlin "coffee script"
Webmontag Berlin "coffee script"
 
Perlのsmart match演算子
Perlのsmart match演算子Perlのsmart match演算子
Perlのsmart match演算子
 
Robert Murdock Band Brings 60s back to S.A. (The Suburban)
Robert Murdock Band Brings 60s back to S.A. (The Suburban)Robert Murdock Band Brings 60s back to S.A. (The Suburban)
Robert Murdock Band Brings 60s back to S.A. (The Suburban)
 
Building Your First Widget
Building Your First WidgetBuilding Your First Widget
Building Your First Widget
 
Perl6 in-production
Perl6 in-productionPerl6 in-production
Perl6 in-production
 
The Joy of Smartmatch
The Joy of SmartmatchThe Joy of Smartmatch
The Joy of Smartmatch
 
Simulating Artificial Muscles for Controlling a Robotic Arm with Fluctuation
Simulating Artificial Muscles for Controlling a Robotic Arm with FluctuationSimulating Artificial Muscles for Controlling a Robotic Arm with Fluctuation
Simulating Artificial Muscles for Controlling a Robotic Arm with Fluctuation
 
LAMP_TRAINING_SESSION_1
LAMP_TRAINING_SESSION_1LAMP_TRAINING_SESSION_1
LAMP_TRAINING_SESSION_1
 
pt-query-digest は Perl!!
pt-query-digest は Perl!!pt-query-digest は Perl!!
pt-query-digest は Perl!!
 
FrontendLab: Programming UI with FRP and Bacon js - Вячеслав Ворончук
FrontendLab: Programming UI with FRP and Bacon js - Вячеслав ВорончукFrontendLab: Programming UI with FRP and Bacon js - Вячеслав Ворончук
FrontendLab: Programming UI with FRP and Bacon js - Вячеслав Ворончук
 
PerlでWeb API入門
PerlでWeb API入門PerlでWeb API入門
PerlでWeb API入門
 

Similar to SFUSGS

Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineAndy McKay
 
Exploiting Php With Php
Exploiting Php With PhpExploiting Php With Php
Exploiting Php With PhpJeremy Coates
 
Exploring the Sweet Spot: Geolocation, Health, and Gov-data
Exploring the Sweet Spot: Geolocation, Health, and Gov-data Exploring the Sweet Spot: Geolocation, Health, and Gov-data
Exploring the Sweet Spot: Geolocation, Health, and Gov-data Lance Roggendorff
 
Place not Space; Geo without Maps
Place not Space; Geo without MapsPlace not Space; Geo without Maps
Place not Space; Geo without MapsGary Gale
 
Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605Robin Fernandes
 
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...Atlassian
 
rules, events and workflow
rules, events and workflowrules, events and workflow
rules, events and workflowMark Proctor
 
jQuery Performance Rules
jQuery Performance RulesjQuery Performance Rules
jQuery Performance Rulesnagarajhubli
 
Cheap frontend tricks
Cheap frontend tricksCheap frontend tricks
Cheap frontend tricksambiescent
 
Advanced and Hidden WordPress APIs
Advanced and Hidden WordPress APIsAdvanced and Hidden WordPress APIs
Advanced and Hidden WordPress APIsandrewnacin
 
My First Rails Plugin - Usertext
My First Rails Plugin - UsertextMy First Rails Plugin - Usertext
My First Rails Plugin - Usertextfrankieroberto
 
Zoo management adri jovin
Zoo management  adri jovinZoo management  adri jovin
Zoo management adri jovinAdri Jovin
 
Security: The Great WordPress Lockdown - WordCamp Melbourne - February 2011
Security: The Great WordPress Lockdown - WordCamp Melbourne - February 2011Security: The Great WordPress Lockdown - WordCamp Melbourne - February 2011
Security: The Great WordPress Lockdown - WordCamp Melbourne - February 2011John Ford
 
WordPressでIoTをはじめよう
WordPressでIoTをはじめようWordPressでIoTをはじめよう
WordPressでIoTをはじめようYuriko IKEDA
 
Scripting GeoServer with GeoScript
Scripting GeoServer with GeoScriptScripting GeoServer with GeoScript
Scripting GeoServer with GeoScriptJustin Deoliveira
 

Similar to SFUSGS (20)

JQuery Basics
JQuery BasicsJQuery Basics
JQuery Basics
 
Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App Engine
 
Exploiting Php With Php
Exploiting Php With PhpExploiting Php With Php
Exploiting Php With Php
 
Exploring the Sweet Spot: Geolocation, Health, and Gov-data
Exploring the Sweet Spot: Geolocation, Health, and Gov-data Exploring the Sweet Spot: Geolocation, Health, and Gov-data
Exploring the Sweet Spot: Geolocation, Health, and Gov-data
 
Ae internals
Ae internalsAe internals
Ae internals
 
Prototype js
Prototype jsPrototype js
Prototype js
 
Place not Space; Geo without Maps
Place not Space; Geo without MapsPlace not Space; Geo without Maps
Place not Space; Geo without Maps
 
Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605
 
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
 
Scala 2 + 2 > 4
Scala 2 + 2 > 4Scala 2 + 2 > 4
Scala 2 + 2 > 4
 
rules, events and workflow
rules, events and workflowrules, events and workflow
rules, events and workflow
 
jQuery Performance Rules
jQuery Performance RulesjQuery Performance Rules
jQuery Performance Rules
 
Cheap frontend tricks
Cheap frontend tricksCheap frontend tricks
Cheap frontend tricks
 
Advanced and Hidden WordPress APIs
Advanced and Hidden WordPress APIsAdvanced and Hidden WordPress APIs
Advanced and Hidden WordPress APIs
 
My First Rails Plugin - Usertext
My First Rails Plugin - UsertextMy First Rails Plugin - Usertext
My First Rails Plugin - Usertext
 
Zoo management adri jovin
Zoo management  adri jovinZoo management  adri jovin
Zoo management adri jovin
 
Security: The Great WordPress Lockdown - WordCamp Melbourne - February 2011
Security: The Great WordPress Lockdown - WordCamp Melbourne - February 2011Security: The Great WordPress Lockdown - WordCamp Melbourne - February 2011
Security: The Great WordPress Lockdown - WordCamp Melbourne - February 2011
 
JSON and the APInauts
JSON and the APInautsJSON and the APInauts
JSON and the APInauts
 
WordPressでIoTをはじめよう
WordPressでIoTをはじめようWordPressでIoTをはじめよう
WordPressでIoTをはじめよう
 
Scripting GeoServer with GeoScript
Scripting GeoServer with GeoScriptScripting GeoServer with GeoScript
Scripting GeoServer with GeoScript
 

More from David Shamma

Recommending Actions, Not Content
Recommending Actions, Not ContentRecommending Actions, Not Content
Recommending Actions, Not ContentDavid Shamma
 
Staying together: Understanding People and Media in Synchronous Connected Sy...
Staying together:  Understanding People and Media in Synchronous Connected Sy...Staying together:  Understanding People and Media in Synchronous Connected Sy...
Staying together: Understanding People and Media in Synchronous Connected Sy...David Shamma
 
Human to Dancer Interaction: Designing for Embodied Performances in a Partici...
Human to Dancer Interaction: Designing for Embodied Performances in a Partici...Human to Dancer Interaction: Designing for Embodied Performances in a Partici...
Human to Dancer Interaction: Designing for Embodied Performances in a Partici...David Shamma
 
A Movie And A Chat
A Movie And A ChatA Movie And A Chat
A Movie And A ChatDavid Shamma
 
Synergies Between Search and Social Metrics
Synergies Between Search and Social MetricsSynergies Between Search and Social Metrics
Synergies Between Search and Social MetricsDavid Shamma
 
Video Creativity beyond Dissemination
Video Creativity beyond DisseminationVideo Creativity beyond Dissemination
Video Creativity beyond DisseminationDavid Shamma
 
Watch What I Watch
Watch  What  I  WatchWatch  What  I  Watch
Watch What I WatchDavid Shamma
 

More from David Shamma (9)

Recommending Actions, Not Content
Recommending Actions, Not ContentRecommending Actions, Not Content
Recommending Actions, Not Content
 
Staying together: Understanding People and Media in Synchronous Connected Sy...
Staying together:  Understanding People and Media in Synchronous Connected Sy...Staying together:  Understanding People and Media in Synchronous Connected Sy...
Staying together: Understanding People and Media in Synchronous Connected Sy...
 
Human to Dancer Interaction: Designing for Embodied Performances in a Partici...
Human to Dancer Interaction: Designing for Embodied Performances in a Partici...Human to Dancer Interaction: Designing for Embodied Performances in a Partici...
Human to Dancer Interaction: Designing for Embodied Performances in a Partici...
 
A Movie And A Chat
A Movie And A ChatA Movie And A Chat
A Movie And A Chat
 
Tweet the Debates
Tweet the DebatesTweet the Debates
Tweet the Debates
 
Synergies Between Search and Social Metrics
Synergies Between Search and Social MetricsSynergies Between Search and Social Metrics
Synergies Between Search and Social Metrics
 
Spinning Online
Spinning OnlineSpinning Online
Spinning Online
 
Video Creativity beyond Dissemination
Video Creativity beyond DisseminationVideo Creativity beyond Dissemination
Video Creativity beyond Dissemination
 
Watch What I Watch
Watch  What  I  WatchWatch  What  I  Watch
Watch What I Watch
 

Recently uploaded

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 

Recently uploaded (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 

SFUSGS

  • 1. @sfusgs Geo-tweet my quake… @ayman • yahoo! research http://en.wikipedia.org/wiki/File:San_francisco_1906_earthquake.jpg
  • 2. Zync • Y! Messenger
  • 13. Trust me, it is just XML
  • 18. The flow was simple CRON this:: cUrl XML feed from USGS find local quakes bit.ly the quake permalink if not duplicate record this quake tweet this quake
  • 19. def fetch_quakes(): def fetch_quakes(): api = bitly.Api(login=’ABCDEF', apikey=’12345678901234567890') rss = parse(urllib.urlopen(USGS_URL)).getroot() quakes = [] for element in rss.findall('{%s}entry' % USGS_NS): title = element.findtext('{%s}title' % USGS_NS) if (title.find("San Francisco Bay") > -1): point = element.findtext('{%s}point' % GEORSS_NS) points = point.split(None, 1) link = element.find('{%s}link' % USGS_NS) href = 'http://earthquakes.usgs.gov%s' % link.get('href') href = api.shorten(href) if (is_duplicate(href) is False): f = open(‘urls.txt', 'a') f.write('%s' % href) f.close() summary = element.findtext('{%s}summary' % USGS_NS) summary = summary.split("<br>")[1] summary = summary.replace(' at epicenter</p><p>', ' ') summary = strip_tags(summary) quakes.append({'title': element.findtext('{%s}title' % USGS_NS), 'link' : href, 'updated' : element.findtext('{%s}updated' % USGS_NS), 'long' : points[1], 'lat' : points[0], 'elev' : element.findtext('{%s}elev' % GEORSS_NS), 'summary' : summary}) return quakes
  • 20. def is_duplicate(url): def is_duplicate(url): from subprocess import call if(os.path.exists(‘urls.txt') is False): call(['/usr/bin/touch', ‘urls.txt']) r = call(['/bin/fgrep', url, ‘urls.txt']) if (r == 0): return True else: return False
  • 21. def send_tweet(t): def send_tweet(t): import httplib2 username = ’ABCDEFG' password = ’12345678901234567890' msg = ('%s %s %s' % (t['title'], t['link'], t['summary'])) http = httplib2.Http() http.add_credentials(username, password) response = http.request( "http://twitter.com/statuses/update.xml", "POST", urllib.urlencode({"status": msg, "lat": t['lat'], "long": t['long']}) ) SEE: http://code.google.com/p/httplib2/ ps: you shouldn’t store your passwords like that…this is just an illustration
  • 22. fin
  • 24. USGS on Open Gov’t
  • 25. Open Questions? How can other local sources be disseminated? How can mass media be filtered so it can be consumed in a similar manner? Can we collect information around the news? For example, find all the tweets that relate to a particular quake. Thanks, @ayman.

Editor's Notes

  1. Use d to be you could look out the window…
  2. I’m from Y!R MESS IEG.
  3. Toms first quake.