Mashups with Drupal and QueryPath

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    2 Favorites

    Mashups with Drupal and QueryPath - Presentation Transcript

    1. Web Services, Mashups, & QueryPath Drupal Camp WI, 2009
    2. Matt Butcher First web app: 1995 About a dozen languages Five books, dozens of articles Milkshake problem
    3. 2009 2004
    4. What We’ll Cover • QueryPath: What it is and how it works. • Web services and QueryPath • QueryPath in Drupal • Mashing Stuff Up
    5. A PHP library designed to make working with XML, HTML, and HTTP simple, powerful, and robust
    6. What are people doing with QueryPath?
    7. Designer/Developer Dilemma • Designers create HTML that is pixel perfect • Developers are charged with taking design and turning it into a web tool. • But developers don’t have the designer’s skillset.
    8. TweetyPants.com
    9. Bridge Layers • Data silos are bad, repositories are good • Import and export • Information is shared using XML
    10. Parsing ODT Files <?php require 'QueryPath/QueryPath.php'; $odt = 'zip://o.odt#content.xml'; foreach(qp($odt, 'text|h') as $i) { print $i->text() . \"\\n\"; }
    11. Web Services Flickr, YouTube, Amazon, Twitter, e- Commerce providers, Calias, OpenAmplify, DBPedia, MusicBrainz, Technorati... REST, SOAP, XML-RPC, Linked Data, SPARQL...
    12. Simplicity
    13. The Task Find all <a></a> tags who have the ancestor <div></div>
    14. The DOM API • At least seventeen classes, each with dozens of methods. • Complex data structure. • Checkered history in PHP. • VERY powerful.
    15. SimpleXML • One class, about a dozen functions and methods. • Turns XML into basic objects. • Makes easy stuff easy, and makes everything else insanely hard. Same size as DOM Example
    16. SAX / Expat Same size, fewer features • Event based. • Write your own parser handler. • One per XML format. • Only reliable “legacy” library.
    17. QueryPath • Compact library. • Functions are short and mnemonic. [This space intentionally left blank ] • The power of DOM, but simpler than SimpleXML • (Shhh... don’t tell, but it’s built on the DOM.)
    18. Anatomy of a QueryPath
    19. Powerful
    20. The Features • Query a document • Access remote data • With XPath • Extensions for... • CSS selectors • Advanced XML manipulation (XSLT, • Move around inside the XSD, PI) document • SQL database access • Modify the document • Templates • Access local files
    21. CSS 3 Selectors Source: “Using the QueryPath PHP Library.” Matt Butcher. IBM developerWorks. Mar. 28, 2009 Use CSS Selectors (like in stylesheets) or XPath queries
    22. Traversing an HTML or XML Document There are over a dozen functions for traversing a document. These are similar to jQuery’s traversal functions.
    23. Manipulating a Document • Get and set text, elements, attributes, etc. • Move, clone, delete. • Build arbitrary XML or HTML.
    24. Work with local or remote sources • HTML • SPARQL • SVG images • SOAP • RSS or Atom • Open Office docs • Flickr • DBPedia • Twitter • MusicBrainz • RDF/Linked Data • ...
    25. Extensibility • One library cannot provide everything. • But it can provide an extension mechanism. • Developers can integrate their own code easily. • You provide the kitchen sink.
    26. Built-in Extensions • QPDB: QueryPath SQL Database layer • QPTPL: Template support for QueryPath • QPXML: Extensions for serious XML hacking • More...
    27. Twitter Search Ten Lines of Code
    28. Drupal Module
    29. The Kewpie Demo • QueryPath module • QP Cache module • Amplify module • QP Services module
    30. Demos Instant Portal video: http://www.youtube.com/watch?v=GBBKPIva1tM Twitter Rating (TweetyPants): http://tweetypants.com
    31. Learn More • QueryPath.org • Technosophos.com • IBM developerWorks • Drupal.org/project/... • querypath • amplify • qpservices
    32. Questions? Matt Butcher http://twitter.com/technosophos http://technosophos.com

    + Matt ButcherMatt Butcher, 5 months ago

    custom

    675 views, 2 favs, 0 embeds more stats

    QueryPath provides a jQuery-like tool in PHP. Use i more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 675
      • 675 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 2
    • Downloads 12
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories