SlideShare una empresa de Scribd logo
1 de 56
memories of
tumblr gear & Tumblrowl
                @honishi
    tumblr developer’s meetup jp 2011
              17 dec 2011
honishi?
@honishi
                           hiroyuki onishi
                           honishi.tumblr.com
                           since mid 2008



• not a truly seasoned programmer
• writing code just for fun
• consultant for FAST Search Server at Microsoft
“honishi” is my secondary identity on the web,
             my primary ones are:
@notomamiko
fuckyeahnotomamiko.tumblr.com




@kugimiyarie
fuckyeahkugimiyarie.tumblr.com
summary
✴ living in yukari kingdom
✴ a dedicated notomamist
✴ a patient with kugimiya disease (type: n)
today’s topic
✓ tumblr gear for iPhone
✓ Tumblrowl for Mac OS X
tumblr gear
tumblr gear?



ancient tumblr client for iPhone
core concept
• prerequisiteexcept login
   • no api,
   • poor performance of iPhone 3g
• scraping
   • text-based scraping
   • not xml-based: fat?
        • dom...... slow?
        • sax complex?
• as fast as possible
   • minimize processing
   • minimize network traffic
main user interface
• lots of webviews...

                                             UIWebView
                                         UIWebView
                                      UIWebView
                                  UIWebView
                               UIWebView
                           UIWebView
                        UIWebView
                    UIWebView
                 UIWebView
             UIWebView
          UIWebView
      UIWebView
   UIWebView




         x11 for browsing              x2 for reblogging
         (1 unhidden, 10 hidden)          (always hidden)
main user interface
        (cont’d)
• it’s slow to start rendering all webview at
  one time
• so webviews are gradually warmed up




                                         (debug view)
days of fixing app
• initial release ... jun 2009
    • released after 4 rejections by Apple
• days of fixing app ... after release
    • every little modification on dashboard
       affects app’s scraping logic
an opinion from
      the opinion leader
• scraping should be executed on server side
 • when is a need to modify scraping logic
    there
           the structure of html changes,

 • if the logic is implemented long time to
    application, it usually takes
                                  within client
      release fixed app; submit the build, wait
      for Apple’s review, being reviewed by
      Apple...
  •   it’s also better for cross-platform
      application provisioning
maybe it’s true,
    but...
weakness of
       server side scraping
•   scalability?
  •      all connections & accesses in single point
  •      need to invest for computing resources there
•   possibility of ban?
  •      service provider can easily identify massive
         transactions from one location
  •      once banned, it’s over
•   security?
  •      no oauth provided at that time
  •      so need to have & use user’s password at server
         side
still yet
client side scraping...
restructuring for
       fault-tolerance
• splitting the scraping processes into 2 blocks:
    • logic for scraping
    • metadata for above
• store them in difference places:
    • logic inside of the app
    • metadata outside of the app, s3
• metadata is read from the app at the time of
  startup.
logic & metadata
      logic(process):                    metadata:

       1. read dashboard                     base url?



         2. pre-process                    target? how?


                                          boundaries for:
          3. split posts
                                     html header? footer? post?


4. find next link (then back to 1.)          base url?
                                       elements for the url?



         inside app                     outside app
scraping metadata
• simple property list
• almost all rules are written in simple string
  or regular expression
• located on amazon s3
  •   http://s3.amazonaws.com/tumblrgear/parsemeta.plist
scraping metadata
     (cont’d)
reading dashboard
overview: dashboard
                           html header

                            post #1

                            post #2

                                :
dashboard   preprocessed
   html         html
                            post #9

                            post #10

                           (next link)

                           html footer
#1. read dashboard
• login, v1 api
• read regular html from the url defined in
  metadata
    #         key                     value
    1   baseUrl     http://www.tumblr.com
#2. pre-process
• regular the weight of html
          expression (replace)
• reduce unwanted images
   • disable javascripts
   • disable img src to *_250.[jpg|gif] etc...
   • change
    #         key                                value
    1   pageReplace   src="http://assets.tumblr.com/images/.*" ;; removed
    2   pageReplace   <(script .*?</script)> ;; <!--$1-->
                      src=(".*?)_(400|500).(jpg|png|gif)(") ;;
    3   pageReplace   ORIGINAL_SRC=$1_$2.$3$4 src=$1_250.$3$4
               :                                    :
                                        ( A ;; B ... replace A with B )
#2. pre-process(cont’d)
• override cssrequired
                for iPhone
• highre-replace img src to *_500.[jpg|gif]
       reso, if
   •
    #         key                                  value
                          (</head>) ;; <style type="text/css">
                          <!--
                          body {
                          margin: 0px;
                          padding: 43px 0px 43px 0px;
    1   pageReplace       (snip)
                          -->
                          </style>
                          <meta name="viewport" content="width=320">
                          $1

    2   highResoReplace   ORIGINAL_SRC="(.*)" src=".*?" ;; HIGH_RESO src="$1"

    3           :                                     :
#3. split post
• detect boundaries in the html
• then split them into header, footer and
  posts
    #           key                               value
    1   pageHeaderSplitter   <!-- START POSTS -->
    2   pageFooterSplitter   <!-- END POSTS -->
    3   postBeginSplitter    <li id="post_
    4   postEndSplitter      <!-- END POSTS -->
#4. find next link
• find next link next link using elements
                elements
• assemble the
    #          key                             value
    1   nextLinkUrl       http://www.tumblr.com{1}
    2   nextLinkElements <a id="next_page_link" href="(.*)">




• then read next page
stored posts
html header           header

 post #1               footer                header

 post #2

     :                                      post #n

 post #9               posts
                       array
 post #10                                    footer


html footer



split html       stored separately   concatenate on demand
reblog & like
reblog
• detect reblog url of the post
    #          key                              value
    1   reblogUrl         http://www.tumblr.com{1}
    2   reblogElements    <a href="(/reblog/.*?)">




• get the raw html from the url
reblog (cont’d)
• preprocess the html (disable img src etc...)
    #          key                                value
    1   reblogReplace   <(script .*?</script)> ;; <!--$1-->
    2   reblogReplace   <link ;; <disabled_link
    3   reblogReplace   <img ;; <disabled_img




• send the html to webview for reblogging
reblog (cont’d)
• do the javascript thingsinto text area, if provided
   • put the commentbutton
   • push the submit
    #            key                                value
    1   reblogAddCommentJS   (javascript here ... snip)
    2   reblogSubmitJS       (javascript here ... snip)

• wait for redirect back to dashboard
    #            key                                value
    1   reblogRedirectUrl http://www.tumblr.com/dashboard


• done
like
• detect like url of the post
    #             key                          value
    1   likeUrl         http://www.tumblr.com/like/{2}?form_key={3}&id={1}
    2   likeElements    type="hidden" name="id" value="(.*?)"
    3   likeElements    action="/like/(.*?)"
    4   likeElements    name="form_key"s+value="(.*?)"




• do the simple postcode 200
• wait for response
• done
sales & trends
• average 1,800 downloads/week?
sales & trends (cont’d)
• US market is now 3 times larger than
  Japanese one ?
enhancement plan
• n/a
recommended
        migration path
• for iOS users ... Tumbletail
• for Android users ... Tumblife
conclusion
• ibecause:currently do not use this app,
    myself

    • softbank’s very poor signal everywhere
    • reducing numberenough for me to
       accounts, so it’s
                         of following
      check the dashboard using pc in the
      bed
Tumblrowl
Tumblrowl?




Growl-like dashboard application for Mac OS X
motivation to build
• recently...
   • i don’t wanna do anything...
   • just wanna watch niconama...



          hataratti aka
motivation to build
        (cont’d)
• i don’t wanna do anything (reprise)
tumblr?
tired of pressing j & k,
     but missing...
my requirements
• no user input requiredscreen
• effective utilization of


  yorufukurou      chrome        here!
it’s tumblr + Growl
architecture
• Growl, forked
• network
   • OAuthConsumer for v2 api
   • ASIHTTPRequest
• misc
   • RegexKitLite
   • JSON Framework
   • Sparkle
overview
                                   suspend?



dashboard
    api          post queue                    display queue        display
                 (mutable array)               (mutable array)     (nswindow)
w/ since_id
                                     1 post
                                   / dequeue


   polling every 10 sec                   polling every 2 sec

                                                                 •open post?
                                                                 •reblog?
                                                                 •like?
Growl, forked
• extracting the display window from Growl
             the displaying module
• extending
   out of box window:       extended window:
  x                     x                        r o l
  icon   title          avatar       blog name
         description
                         image area


                         upper text area


                         lower text area


                             title
                             source
miscellaneous
• oauth & webview
   • all cookiesofare shared (default behavior)
      instances webview
                              in safari & all

   • so the login sequence to get authorized
      doesn’t work expectedly
   • need to override containerinmanually
      to handle cookie
                        delegate webview

   • xauth...?
miscellaneous (cont’d)
• avoiding reblog display limit
                  storm
   • implement free space seeking logic
   • by hooking
conclusion
• i myself currently do not use this app,
  because i find it distracting... seriously...
appendix: icons
icons for tumblr gear
• designed by charactoy
• 3,000- for each




• http://www.charactoy.com/
icons for Tumblrowl
• designed by diwakar ganesh (designcrowd)
• $365.65-




• http://www.designcrowd.com/
thank you.




                          @honishi
                onishi.hiroyuki@gmail.com
                               special thanks:
      inu(nihon henshu ongaku kyokai), nonSectRadicals, mamiko noto,
shingo yamanaka, jeffrey kuo, midori yokoyama, naoto ohara, masami iwasawa

Más contenido relacionado

La actualidad más candente

Ruby MVC from scratch with Rack
Ruby MVC from scratch with RackRuby MVC from scratch with Rack
Ruby MVC from scratch with RackDonSchado
 
PHP language presentation
PHP language presentationPHP language presentation
PHP language presentationAnnujj Agrawaal
 
Using an API
Using an APIUsing an API
Using an APIAdam Culp
 
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyConsegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyFabio Akita
 
Pourquoi ruby et rails déchirent
Pourquoi ruby et rails déchirentPourquoi ruby et rails déchirent
Pourquoi ruby et rails déchirentNicolas Ledez
 
Introduction to Selenium and Ruby
Introduction to Selenium and RubyIntroduction to Selenium and Ruby
Introduction to Selenium and RubyYnon Perek
 
Lua web development and Sailor @conc_at 2015
Lua web development and Sailor @conc_at 2015Lua web development and Sailor @conc_at 2015
Lua web development and Sailor @conc_at 2015Etiene Dalcol
 
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDBBattle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDBJesse Wolgamott
 
Grand Rapids PHP Meetup: Behavioral Driven Development with Behat
Grand Rapids PHP Meetup: Behavioral Driven Development with BehatGrand Rapids PHP Meetup: Behavioral Driven Development with Behat
Grand Rapids PHP Meetup: Behavioral Driven Development with BehatRyan Weaver
 
Cms & wordpress theme development 2011
Cms & wordpress theme development 2011Cms & wordpress theme development 2011
Cms & wordpress theme development 2011Dave Wallace
 
Ezobject wrapper workshop
Ezobject wrapper workshopEzobject wrapper workshop
Ezobject wrapper workshopKaliop-slide
 
Building an HTML5 Video Player
Building an HTML5 Video PlayerBuilding an HTML5 Video Player
Building an HTML5 Video PlayerJim Jeffers
 
Scrippets — the way to refine Snippets Application
Scrippets — the way to refine Snippets ApplicationScrippets — the way to refine Snippets Application
Scrippets — the way to refine Snippets ApplicationSnippets
 
REST in practice with Symfony2
REST in practice with Symfony2REST in practice with Symfony2
REST in practice with Symfony2Daniel Londero
 
Symfony2, Backbone.js &amp; socket.io - SfLive Paris 2k13 - Wisembly
Symfony2, Backbone.js &amp; socket.io - SfLive Paris 2k13 - WisemblySymfony2, Backbone.js &amp; socket.io - SfLive Paris 2k13 - Wisembly
Symfony2, Backbone.js &amp; socket.io - SfLive Paris 2k13 - WisemblyGuillaume POTIER
 

La actualidad más candente (19)

Ruby MVC from scratch with Rack
Ruby MVC from scratch with RackRuby MVC from scratch with Rack
Ruby MVC from scratch with Rack
 
PHP language presentation
PHP language presentationPHP language presentation
PHP language presentation
 
Using an API
Using an APIUsing an API
Using an API
 
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyConsegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
 
Pourquoi ruby et rails déchirent
Pourquoi ruby et rails déchirentPourquoi ruby et rails déchirent
Pourquoi ruby et rails déchirent
 
Introduction to Selenium and Ruby
Introduction to Selenium and RubyIntroduction to Selenium and Ruby
Introduction to Selenium and Ruby
 
Lua web development and Sailor @conc_at 2015
Lua web development and Sailor @conc_at 2015Lua web development and Sailor @conc_at 2015
Lua web development and Sailor @conc_at 2015
 
Extending Studio
Extending StudioExtending Studio
Extending Studio
 
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDBBattle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
Battle of NoSQL stars: Amazon's SDB vs MongoDB vs CouchDB vs RavenDB
 
Grand Rapids PHP Meetup: Behavioral Driven Development with Behat
Grand Rapids PHP Meetup: Behavioral Driven Development with BehatGrand Rapids PHP Meetup: Behavioral Driven Development with Behat
Grand Rapids PHP Meetup: Behavioral Driven Development with Behat
 
Please dont touch-3.5
Please dont touch-3.5Please dont touch-3.5
Please dont touch-3.5
 
Cms & wordpress theme development 2011
Cms & wordpress theme development 2011Cms & wordpress theme development 2011
Cms & wordpress theme development 2011
 
Rails 4.0
Rails 4.0Rails 4.0
Rails 4.0
 
Ezobject wrapper workshop
Ezobject wrapper workshopEzobject wrapper workshop
Ezobject wrapper workshop
 
ngCore
ngCorengCore
ngCore
 
Building an HTML5 Video Player
Building an HTML5 Video PlayerBuilding an HTML5 Video Player
Building an HTML5 Video Player
 
Scrippets — the way to refine Snippets Application
Scrippets — the way to refine Snippets ApplicationScrippets — the way to refine Snippets Application
Scrippets — the way to refine Snippets Application
 
REST in practice with Symfony2
REST in practice with Symfony2REST in practice with Symfony2
REST in practice with Symfony2
 
Symfony2, Backbone.js &amp; socket.io - SfLive Paris 2k13 - Wisembly
Symfony2, Backbone.js &amp; socket.io - SfLive Paris 2k13 - WisemblySymfony2, Backbone.js &amp; socket.io - SfLive Paris 2k13 - Wisembly
Symfony2, Backbone.js &amp; socket.io - SfLive Paris 2k13 - Wisembly
 

Similar a memories of tumblr gear & Tumblrowl

External JavaScript Widget Development Best Practices
External JavaScript Widget Development Best PracticesExternal JavaScript Widget Development Best Practices
External JavaScript Widget Development Best PracticesVolkan Özçelik
 
Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012Volkan Özçelik
 
External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1) External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1) Volkan Özçelik
 
Nsc 2013 06-17 - random rants on 2013
Nsc 2013 06-17 - random rants on 2013Nsc 2013 06-17 - random rants on 2013
Nsc 2013 06-17 - random rants on 2013Mikael Svenson
 
Masterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsMasterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsFabian Jakobs
 
Html5: Something wicked this way comes (Hack in Paris)
Html5: Something wicked this way comes (Hack in Paris)Html5: Something wicked this way comes (Hack in Paris)
Html5: Something wicked this way comes (Hack in Paris)Krzysztof Kotowicz
 
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...Reuven Lerner
 
Modern Web Technologies — Jerusalem Web Professionals, January 2011
Modern Web Technologies — Jerusalem Web Professionals, January 2011Modern Web Technologies — Jerusalem Web Professionals, January 2011
Modern Web Technologies — Jerusalem Web Professionals, January 2011Reuven Lerner
 
Great Tools Heavily Used In Japan, You Don't Know.
Great Tools Heavily Used In Japan, You Don't Know.Great Tools Heavily Used In Japan, You Don't Know.
Great Tools Heavily Used In Japan, You Don't Know.Junichi Ishida
 
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)François Massart
 
The things we found in your website
The things we found in your websiteThe things we found in your website
The things we found in your websitehernanibf
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Henry S
 
Don't make me wait! or Building High-Performance Web Applications
Don't make me wait! or Building High-Performance Web ApplicationsDon't make me wait! or Building High-Performance Web Applications
Don't make me wait! or Building High-Performance Web ApplicationsStoyan Stefanov
 
HTML5 History & Features
HTML5 History & FeaturesHTML5 History & Features
HTML5 History & FeaturesDave Ross
 
5 Common Mistakes You are Making on your Website
 5 Common Mistakes You are Making on your Website 5 Common Mistakes You are Making on your Website
5 Common Mistakes You are Making on your WebsiteAcquia
 
Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst
Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirstBuilding CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst
Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirstJun-ichi Sakamoto
 
Mobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPressMobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPressDanilo Ercoli
 
GeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPressGeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPressGGDBologna
 

Similar a memories of tumblr gear & Tumblrowl (20)

External JavaScript Widget Development Best Practices
External JavaScript Widget Development Best PracticesExternal JavaScript Widget Development Best Practices
External JavaScript Widget Development Best Practices
 
Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012
 
External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1) External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1)
 
React nativebeginner1
React nativebeginner1React nativebeginner1
React nativebeginner1
 
Nsc 2013 06-17 - random rants on 2013
Nsc 2013 06-17 - random rants on 2013Nsc 2013 06-17 - random rants on 2013
Nsc 2013 06-17 - random rants on 2013
 
Angular SEO
Angular SEO Angular SEO
Angular SEO
 
Masterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsMasterin Large Scale Java Script Applications
Masterin Large Scale Java Script Applications
 
Html5: Something wicked this way comes (Hack in Paris)
Html5: Something wicked this way comes (Hack in Paris)Html5: Something wicked this way comes (Hack in Paris)
Html5: Something wicked this way comes (Hack in Paris)
 
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
 
Modern Web Technologies — Jerusalem Web Professionals, January 2011
Modern Web Technologies — Jerusalem Web Professionals, January 2011Modern Web Technologies — Jerusalem Web Professionals, January 2011
Modern Web Technologies — Jerusalem Web Professionals, January 2011
 
Great Tools Heavily Used In Japan, You Don't Know.
Great Tools Heavily Used In Japan, You Don't Know.Great Tools Heavily Used In Japan, You Don't Know.
Great Tools Heavily Used In Japan, You Don't Know.
 
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)
 
The things we found in your website
The things we found in your websiteThe things we found in your website
The things we found in your website
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
 
Don't make me wait! or Building High-Performance Web Applications
Don't make me wait! or Building High-Performance Web ApplicationsDon't make me wait! or Building High-Performance Web Applications
Don't make me wait! or Building High-Performance Web Applications
 
HTML5 History & Features
HTML5 History & FeaturesHTML5 History & Features
HTML5 History & Features
 
5 Common Mistakes You are Making on your Website
 5 Common Mistakes You are Making on your Website 5 Common Mistakes You are Making on your Website
5 Common Mistakes You are Making on your Website
 
Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst
Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirstBuilding CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst
Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst
 
Mobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPressMobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPress
 
GeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPressGeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPress
 

Último

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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 organizationRadu Cotescu
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The Evolution of Money: Digital Transformation and CBDCs in Central Banking
The Evolution of Money: Digital Transformation and CBDCs in Central BankingThe Evolution of Money: Digital Transformation and CBDCs in Central Banking
The Evolution of Money: Digital Transformation and CBDCs in Central BankingSelcen Ozturkcan
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 

Último (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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
 
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...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
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
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The Evolution of Money: Digital Transformation and CBDCs in Central Banking
The Evolution of Money: Digital Transformation and CBDCs in Central BankingThe Evolution of Money: Digital Transformation and CBDCs in Central Banking
The Evolution of Money: Digital Transformation and CBDCs in Central Banking
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 

memories of tumblr gear & Tumblrowl

  • 1. memories of tumblr gear & Tumblrowl @honishi tumblr developer’s meetup jp 2011 17 dec 2011
  • 3. @honishi hiroyuki onishi honishi.tumblr.com since mid 2008 • not a truly seasoned programmer • writing code just for fun • consultant for FAST Search Server at Microsoft
  • 4. “honishi” is my secondary identity on the web, my primary ones are:
  • 6. summary ✴ living in yukari kingdom ✴ a dedicated notomamist ✴ a patient with kugimiya disease (type: n)
  • 7. today’s topic ✓ tumblr gear for iPhone ✓ Tumblrowl for Mac OS X
  • 9. tumblr gear? ancient tumblr client for iPhone
  • 10. core concept • prerequisiteexcept login • no api, • poor performance of iPhone 3g • scraping • text-based scraping • not xml-based: fat? • dom...... slow? • sax complex? • as fast as possible • minimize processing • minimize network traffic
  • 11. main user interface • lots of webviews... UIWebView UIWebView UIWebView UIWebView UIWebView UIWebView UIWebView UIWebView UIWebView UIWebView UIWebView UIWebView UIWebView x11 for browsing x2 for reblogging (1 unhidden, 10 hidden) (always hidden)
  • 12. main user interface (cont’d) • it’s slow to start rendering all webview at one time • so webviews are gradually warmed up (debug view)
  • 13. days of fixing app • initial release ... jun 2009 • released after 4 rejections by Apple • days of fixing app ... after release • every little modification on dashboard affects app’s scraping logic
  • 14. an opinion from the opinion leader • scraping should be executed on server side • when is a need to modify scraping logic there the structure of html changes, • if the logic is implemented long time to application, it usually takes within client release fixed app; submit the build, wait for Apple’s review, being reviewed by Apple... • it’s also better for cross-platform application provisioning
  • 16. weakness of server side scraping • scalability? • all connections & accesses in single point • need to invest for computing resources there • possibility of ban? • service provider can easily identify massive transactions from one location • once banned, it’s over • security? • no oauth provided at that time • so need to have & use user’s password at server side
  • 17. still yet client side scraping...
  • 18. restructuring for fault-tolerance • splitting the scraping processes into 2 blocks: • logic for scraping • metadata for above • store them in difference places: • logic inside of the app • metadata outside of the app, s3 • metadata is read from the app at the time of startup.
  • 19. logic & metadata logic(process): metadata: 1. read dashboard base url? 2. pre-process target? how? boundaries for: 3. split posts html header? footer? post? 4. find next link (then back to 1.) base url? elements for the url? inside app outside app
  • 20. scraping metadata • simple property list • almost all rules are written in simple string or regular expression • located on amazon s3 • http://s3.amazonaws.com/tumblrgear/parsemeta.plist
  • 21. scraping metadata (cont’d)
  • 23. overview: dashboard html header post #1 post #2 : dashboard preprocessed html html post #9 post #10 (next link) html footer
  • 24. #1. read dashboard • login, v1 api • read regular html from the url defined in metadata # key value 1 baseUrl http://www.tumblr.com
  • 25. #2. pre-process • regular the weight of html expression (replace) • reduce unwanted images • disable javascripts • disable img src to *_250.[jpg|gif] etc... • change # key value 1 pageReplace src="http://assets.tumblr.com/images/.*" ;; removed 2 pageReplace <(script .*?</script)> ;; <!--$1--> src=(".*?)_(400|500).(jpg|png|gif)(") ;; 3 pageReplace ORIGINAL_SRC=$1_$2.$3$4 src=$1_250.$3$4 : : ( A ;; B ... replace A with B )
  • 26. #2. pre-process(cont’d) • override cssrequired for iPhone • highre-replace img src to *_500.[jpg|gif] reso, if • # key value (</head>) ;; <style type="text/css"> <!-- body { margin: 0px; padding: 43px 0px 43px 0px; 1 pageReplace (snip) --> </style> <meta name="viewport" content="width=320"> $1 2 highResoReplace ORIGINAL_SRC="(.*)" src=".*?" ;; HIGH_RESO src="$1" 3 : :
  • 27. #3. split post • detect boundaries in the html • then split them into header, footer and posts # key value 1 pageHeaderSplitter <!-- START POSTS --> 2 pageFooterSplitter <!-- END POSTS --> 3 postBeginSplitter <li id="post_ 4 postEndSplitter <!-- END POSTS -->
  • 28. #4. find next link • find next link next link using elements elements • assemble the # key value 1 nextLinkUrl http://www.tumblr.com{1} 2 nextLinkElements <a id="next_page_link" href="(.*)"> • then read next page
  • 29. stored posts html header header post #1 footer header post #2 : post #n post #9 posts array post #10 footer html footer split html stored separately concatenate on demand
  • 31. reblog • detect reblog url of the post # key value 1 reblogUrl http://www.tumblr.com{1} 2 reblogElements <a href="(/reblog/.*?)"> • get the raw html from the url
  • 32. reblog (cont’d) • preprocess the html (disable img src etc...) # key value 1 reblogReplace <(script .*?</script)> ;; <!--$1--> 2 reblogReplace <link ;; <disabled_link 3 reblogReplace <img ;; <disabled_img • send the html to webview for reblogging
  • 33. reblog (cont’d) • do the javascript thingsinto text area, if provided • put the commentbutton • push the submit # key value 1 reblogAddCommentJS (javascript here ... snip) 2 reblogSubmitJS (javascript here ... snip) • wait for redirect back to dashboard # key value 1 reblogRedirectUrl http://www.tumblr.com/dashboard • done
  • 34. like • detect like url of the post # key value 1 likeUrl http://www.tumblr.com/like/{2}?form_key={3}&id={1} 2 likeElements type="hidden" name="id" value="(.*?)" 3 likeElements action="/like/(.*?)" 4 likeElements name="form_key"s+value="(.*?)" • do the simple postcode 200 • wait for response • done
  • 35. sales & trends • average 1,800 downloads/week?
  • 36. sales & trends (cont’d) • US market is now 3 times larger than Japanese one ?
  • 38. recommended migration path • for iOS users ... Tumbletail • for Android users ... Tumblife
  • 39. conclusion • ibecause:currently do not use this app, myself • softbank’s very poor signal everywhere • reducing numberenough for me to accounts, so it’s of following check the dashboard using pc in the bed
  • 42. motivation to build • recently... • i don’t wanna do anything... • just wanna watch niconama... hataratti aka
  • 43. motivation to build (cont’d) • i don’t wanna do anything (reprise)
  • 44. tumblr? tired of pressing j & k, but missing...
  • 45. my requirements • no user input requiredscreen • effective utilization of yorufukurou chrome here!
  • 47. architecture • Growl, forked • network • OAuthConsumer for v2 api • ASIHTTPRequest • misc • RegexKitLite • JSON Framework • Sparkle
  • 48. overview suspend? dashboard api post queue display queue display (mutable array) (mutable array) (nswindow) w/ since_id 1 post / dequeue polling every 10 sec polling every 2 sec •open post? •reblog? •like?
  • 49. Growl, forked • extracting the display window from Growl the displaying module • extending out of box window: extended window: x x r o l icon title avatar blog name description image area upper text area lower text area title source
  • 50. miscellaneous • oauth & webview • all cookiesofare shared (default behavior) instances webview in safari & all • so the login sequence to get authorized doesn’t work expectedly • need to override containerinmanually to handle cookie delegate webview • xauth...?
  • 51. miscellaneous (cont’d) • avoiding reblog display limit storm • implement free space seeking logic • by hooking
  • 52. conclusion • i myself currently do not use this app, because i find it distracting... seriously...
  • 54. icons for tumblr gear • designed by charactoy • 3,000- for each • http://www.charactoy.com/
  • 55. icons for Tumblrowl • designed by diwakar ganesh (designcrowd) • $365.65- • http://www.designcrowd.com/
  • 56. thank you. @honishi onishi.hiroyuki@gmail.com special thanks: inu(nihon henshu ongaku kyokai), nonSectRadicals, mamiko noto, shingo yamanaka, jeffrey kuo, midori yokoyama, naoto ohara, masami iwasawa

Notas del editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n