SlideShare a Scribd company logo
1 of 143
Download to read offline
Atom Publishing
Protocol, ruby y la
api de 11870.com
      David Calavera
antecedentes
11870.com

   ๏ recuerda y comparte negocios ...




David Calavera                     Conferencia Rails 2007
11870.com

   • recuerda y comparte negocios ...
   ๏ no solo de comentarios vive el hombre




David Calavera                    Conferencia Rails 2007
11870.com

   • recuerda y comparte negocios ...
   • no solo de comentarios vive el hombre
   ๏ ¿por qué tengo que atarme a la web?



David Calavera                     Conferencia Rails 2007
11870.com

   • recuerda y comparte negocios ...
   • no solo de comentarios vive el hombre
   • ¿por qué tengo que atarme a la web?
   ๏ ¿quien tiene que adaptarse?


David Calavera                     Conferencia Rails 2007
atomPub
“the atom publishing protocol is an
   application-level protocol for
   publishing and editing web resources”




David Calavera                  Conferencia Rails 2007
๏ ¿sabes qué es HTTP y como usarlo?




David Calavera                  Conferencia Rails 2007
• ¿sabes qué es HTTP y como usarlo?
   ๏ ¿sabes qué es XML y como usarlo?




David Calavera                   Conferencia Rails 2007
• ¿sabes qué es HTTP y como usarlo?
   • ¿sabes qué es XML y como usarlo?
   ๏ ¿sabes qué es un feed y como crearlo?



David Calavera                   Conferencia Rails 2007
atomPub
características
estándar


         http://ietfreport.isoc.org/idref/rfc5023




David Calavera                            Conferencia Rails 2007
basado en atom
           <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?>
           <feed xmlns=quot;http://www.w3.org/2005/Atomquot; xml:lang=quot;enquot;>
             <id>http://www.verbosemode.com/wp-app.php/posts</id>
             <updated>2007-11-04T11:38:28Z</updated>
             <title type=quot;textquot;>Verbose mode</title>
             <subtitle type=quot;textquot;>Verbose mode</subtitle>
             <entry>
               <id>http://www.verbosemode.com/?p=3</id>
               <title type=quot;textquot;>Spanish Rails Conf 07</title>
               <updated>2007-11-04T11:38:28Z</updated>
               <published>2007-11-04T11:38:28Z</published>
               ...




David Calavera                                             Conferencia Rails 2007
arquitectura REST




David Calavera   Conferencia Rails 2007
arquitectura REST

   ๏ protocolo sin estado




David Calavera              Conferencia Rails 2007
arquitectura REST

   • protocolo sin estado
   ๏ operaciones bien definidas




David Calavera                    Conferencia Rails 2007
arquitectura REST

   • protocolo sin estado
   • operaciones bien definidas
   ๏ sintaxis universal (IRI)



David Calavera                    Conferencia Rails 2007
IRI

www.
                  .w3.mag.keio.ac.jp




 David Calavera      Conferencia Rails 2007
URI
www.%e3%81%bb%e3%82%93%e3%81%a8%e3%81%86%e3%
81%ab%e3%81%aa%e3%81%8c%e3%81%84%e3%82%8f%e3%
81%91%e3%81%ae%e3%82%8f%e3%81%8b%e3%82%89%e3%
81%aa%e3%81%84%e3%81%a9%e3%82%81%e3%81%84%e3%
82%93%e3%82%81%e3%81%84%e3%81%ae%e3%82%89%
e3%81%b9%e3%82%8b%e3%81%be%e3%81%a0%e3%81%aa%
e3%81%8c%e3%81%8f%e3%81%97%e3%81%aa%e3%81%84%
e3%81%a8%e3%81%9f%e3%82%8a%e3%81%aa%e3%81%
84.w3.mag.keio.ac.jp



  David Calavera                 Conferencia Rails 2007
introspectivo




David Calavera   Conferencia Rails 2007
introspectivo

   documento de servicio




David Calavera             Conferencia Rails 2007
introspectivo

   documento de servicio
                 colección
                 colección




David Calavera               Conferencia Rails 2007
introspectivo

   documento de servicio
                 colección
                     elementos
                 colección
                     elementos

David Calavera                   Conferencia Rails 2007
fácilmente extensible
      <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?>
      <feed xmlns=quot;http://www.w3.org/2005/Atomquot; xml:lang=quot;enquot;
          xmlns:openSearch=quot;http://a9.com/-/spec/opensearchrss/1.0/quot;>
        <id>http://www.verbosemode.com/wp-app.php/posts</id>
        <updated>2007-11-04T11:38:28Z</updated>
        <title type=quot;textquot;>Verbose mode</title>
        <subtitle type=quot;textquot;>Verbose mode</subtitle>
        <openSearch:totalResults>1</openSearch:totalResults>
        <openSearch:startIndex>1</openSearch:startIndex>
        <openSearch:itemsPerPage>25</openSearch:itemsPerPage>
        <entry>
          <id>http://www.verbosemode.com/?p=3</id>
          <title type=quot;textquot;>Spanish Rails Conf 07</title>
          <updated>2007-11-04T11:38:28Z</updated>
          <published>2007-11-04T11:38:28Z</published>
          ...



David Calavera                                            Conferencia Rails 2007
multimedia




David Calavera   Conferencia Rails 2007
más...

   ๏ paginación




David Calavera    Conferencia Rails 2007
<?xml version=quot;1.0quot; encoding=quot;utf-8quot;?>
<feed xmlns=quot;http://www.w3.org/2005/Atomquot; xml:lang=quot;enquot;>
  <id>http://www.verbosemode.com/wp-app.php/posts</id>
  <updated>2007-11-04T11:38:28Z</updated>
  <link rel=quot;selfquot; href=quot;http://www.verbosemode.com/wp-app.php/posts?p=3quot;/>
  <link rel=quot;nextquot; href=quot;http://www.verbosemode.com/wp-app.php/posts?p=4quot;/>
  <link rel=quot;previousquot; href=quot;http://www.verbosemode.com/wp-app.php/posts?p=2quot;/>
  <link rel=quot;firstquot; href=quot;http://www.verbosemode.com/wp-app.php/postsquot;/>
  <link rel=quot;lastquot; href=quot;http://www.verbosemode.com/wp-app.php/posts?p=5quot;/>
  ...




   David Calavera                                           Conferencia Rails 2007
más...

   • paginación
   ๏ caché




David Calavera    Conferencia Rails 2007
POST /wp-app.php/posts
      HTTP/1.1 201 Created
        Content-Type: application/atom+xml;type=entry;charset=quot;utf-8quot;
           ETag: quot;c180de84f991g8quot;




David Calavera                                            Conferencia Rails 2007
POST /wp-app.php/posts
      HTTP/1.1 201 Created
        Content-Type: application/atom+xml;type=entry;charset=quot;utf-8quot;
           ETag: quot;c180de84f991g8quot;


      GET /wp-app.php/post/3
      HTTP/1.1 304 Not Modified
           If-None-Match: quot;c180de84f991g8quot;




David Calavera                                            Conferencia Rails 2007
POST /wp-app.php/posts
      HTTP/1.1 201 Created
        Content-Type: application/atom+xml;type=entry;charset=quot;utf-8quot;
           ETag: quot;c180de84f991g8quot;


      GET /wp-app.php/post/3
      HTTP/1.1 304 Not Modified
           If-None-Match: quot;c180de84f991g8quot;



      PUT /wp-app.php/post/3
      HTTP/1.1 412 Precondition Failed
           If-Match: quot;c180de84f991g8quot;




David Calavera                                            Conferencia Rails 2007
más...

   • paginación
   • caché
   ๏ control de estado



David Calavera           Conferencia Rails 2007
<?xml version=quot;1.0quot; encoding=quot;utf-8quot;?>
        <entry xmlns=quot;http://www.w3.org/2005/Atomquot;
              xmlns:app=quot;http://www.w3.org/2007/appquot; xml:lang=quot;enquot;>
          <id>http://www.verbosemode.com/?p=3</id>
          <title type=quot;textquot;>Spanish Rails Conf 07</title>
          <app:control>
            <app:draft>no</app:draft>
          </app:control>
        ...




David Calavera                                            Conferencia Rails 2007
más...

   • paginación
   • caché
   • control de estado
   ๏ seguridad


David Calavera           Conferencia Rails 2007
atomPub
 estructura
atomPub:service

                 GET 'http://www.verbosemode.com/wp-app.php/service'
                 HTTP/1.1 200 OK




David Calavera                                                Conferencia Rails 2007
atomPub:service
<?xml version=quot;1.0quot; encoding=quot;utf-8quot;?>
<service xmlns=quot;http://www.w3.org/2007/appquot;
    xmlns:atom=quot;http://www.w3.org/2005/Atomquot;>
  <workspace>
    <atom:title>Workspace</atom:title>
    <collection href=quot;http://www.verbosemode.com/wp-app.php/postsquot;>
      <atom:title>Posts</atom:title>
      <accept>application/atom+xml;type=entry</accept>
      <categories href=quot;http://www.verbosemode.com/wp-app.php/categoriesquot;/>
    </collection>
    <collection href=quot;http://www.verbosemode.com/wp-app.php/attachmentsquot;>
      <atom:title>Media</atom:title>
      <accept>image/*</accept>
      <accept>audio/*</accept>
      <accept>video/*</accept>
    </collection>
  </workspace>
</service>

David Calavera                                          Conferencia Rails 2007
atomPub:service
<?xml version=quot;1.0quot; encoding=quot;utf-8quot;?>
<service xmlns=quot;http://www.w3.org/2007/appquot;
    xmlns:atom=quot;http://www.w3.org/2005/Atomquot;>
  <workspace>
    <atom:title>Workspace</atom:title>
    <collection href=quot;http://www.verbosemode.com/wp-app.php/postsquot;>
      <atom:title>Posts</atom:title>
      <accept>application/atom+xml;type=entry</accept>
      <categories href=quot;http://www.verbosemode.com/wp-app.php/categoriesquot;/>
    </collection>
    <collection href=quot;http://www.verbosemode.com/wp-app.php/attachmentsquot;>
      <atom:title>Media</atom:title>
      <accept>image/*</accept>
      <accept>audio/*</accept>
      <accept>video/*</accept>
    </collection>
  </workspace>
</service>

David Calavera                                          Conferencia Rails 2007
atomPub:service
<?xml version=quot;1.0quot; encoding=quot;utf-8quot;?>
<service xmlns=quot;http://www.w3.org/2007/appquot;
    xmlns:atom=quot;http://www.w3.org/2005/Atomquot;>
  <workspace>
    <atom:title>Workspace</atom:title>
    <collection href=quot;http://www.verbosemode.com/wp-app.php/postsquot;>
      <atom:title>Posts</atom:title>
      <accept>application/atom+xml;type=entry</accept>
      <categories href=quot;http://www.verbosemode.com/wp-app.php/categoriesquot;/>
    </collection>
    <collection href=quot;http://www.verbosemode.com/wp-app.php/attachmentsquot;>
      <atom:title>Media</atom:title>
      <accept>image/*</accept>
      <accept>audio/*</accept>
      <accept>video/*</accept>
    </collection>
  </workspace>
</service>

David Calavera                                          Conferencia Rails 2007
atomPub:service
<?xml version=quot;1.0quot; encoding=quot;utf-8quot;?>
<service xmlns=quot;http://www.w3.org/2007/appquot;
    xmlns:atom=quot;http://www.w3.org/2005/Atomquot;>
  <workspace>
    <atom:title>Workspace</atom:title>
    <collection href=quot;http://www.verbosemode.com/wp-app.php/postsquot;>
      <atom:title>Posts</atom:title>
      <accept>application/atom+xml;type=entry</accept>
      <categories href=quot;http://www.verbosemode.com/wp-app.php/categoriesquot;/>
    </collection>
    <collection href=quot;http://www.verbosemode.com/wp-app.php/attachmentsquot;>
      <atom:title>Media</atom:title>
      <accept>image/*</accept>
      <accept>audio/*</accept>
      <accept>video/*</accept>
    </collection>
  </workspace>
</service>

David Calavera                                          Conferencia Rails 2007
atomPub:service
<?xml version=quot;1.0quot; encoding=quot;utf-8quot;?>
<service xmlns=quot;http://www.w3.org/2007/appquot;
    xmlns:atom=quot;http://www.w3.org/2005/Atomquot;>
  <workspace>
    <atom:title>Workspace</atom:title>
    <collection href=quot;http://www.verbosemode.com/wp-app.php/postsquot;>
      <atom:title>Posts</atom:title>
      <accept>application/atom+xml;type=entry</accept>
      <categories href=quot;http://www.verbosemode.com/wp-app.php/categoriesquot;/>
    </collection>
    <collection href=quot;http://www.verbosemode.com/wp-app.php/attachmentsquot;>
      <atom:title>Media</atom:title>
      <accept>image/*</accept>
      <accept>audio/*</accept>
      <accept>video/*</accept>
    </collection>
  </workspace>
</service>

David Calavera                                          Conferencia Rails 2007
atomPub:categories

            GET 'http://www.verbosemode.com/wp-app.php/categories'
            HTTP/1.1 200 OK




David Calavera                                             Conferencia Rails 2007
atomPub:categories
         <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?>
         <app:categories xmlns:app=quot;http://www.w3.org/2007/appquot;
             xmlns=quot;http://www.w3.org/2005/Atomquot; fixed=quot;yesquot;
             scheme=quot;http://www.verbosemode.comquot;>
           <category term=quot;atomPubquot; />
           <category term=quot;railsquot; />
         </app:categories>




David Calavera                                            Conferencia Rails 2007
atomPub:collection
     POST 'http://www.verbosemode.com/wp-app.php/posts'
     HTTP/1.1 201 Created
     Content-Type: */*
     Location: 'http://www.verbosemode.com/wp-app.php/post/3'
     Content-Location: 'http://www.verbosemode.com/wp-app.php/post/3'




     GET 'http://www.verbosemode.com/wp-app.php/posts'
     HTTP/1.1 200 OK




David Calavera                                           Conferencia Rails 2007
atomPub:collection
<?xml version=quot;1.0quot; encoding=quot;utf-8quot;?>
<feed xmlns=quot;http://www.w3.org/2005/Atomquot;
    xmlns:app=quot;http://www.w3.org/2007/appquot; xml:lang=quot;enquot;>
  <id>http://www.verbosemode.com/wp-app.php/posts</id>
  <updated>2007-11-04T11:38:28Z</updated>
  <title type=quot;textquot;>Verbose mode</title>
  <link rel=quot;firstquot; href=quot;http://www.verbosemode.com/wp-app.php/postsquot;/>
  <link rel=quot;lastquot; href=quot;http://www.verbosemode.com/wp-app.php/postsquot;/>
  <link rel=quot;selfquot; href=quot;http://www.verbosemode.com/wp-app.php/postsquot;/>
  <entry>
    <id>http://www.verbosemode.com/?p=3</id>
    <title type=quot;textquot;>Spanish Rails Conf 07</title>
    <app:edited>2007-11-04T11:38:28Z</app:edited>
    <link rel=quot;editquot; href=quot;http://www.verbosemode.com/wp-app.php/post/3quot;/>
    <app:control><app:draft>no</app:draft></app:control>
    ...


David Calavera                                           Conferencia Rails 2007
atomPub:collection
<?xml version=quot;1.0quot; encoding=quot;utf-8quot;?>
<feed xmlns=quot;http://www.w3.org/2005/Atomquot;
    xmlns:app=quot;http://www.w3.org/2007/appquot; xml:lang=quot;enquot;>
  <id>http://www.verbosemode.com/wp-app.php/posts</id>
  <updated>2007-11-04T11:38:28Z</updated>
  <title type=quot;textquot;>Verbose mode</title>
  <link rel=quot;firstquot; href=quot;http://www.verbosemode.com/wp-app.php/postsquot;/>
  <link rel=quot;lastquot; href=quot;http://www.verbosemode.com/wp-app.php/postsquot;/>
  <link rel=quot;selfquot; href=quot;http://www.verbosemode.com/wp-app.php/postsquot;/>
  <entry>
    <id>http://www.verbosemode.com/?p=3</id>
    <title type=quot;textquot;>Spanish Rails Conf 07</title>
    <app:edited>2007-11-04T11:38:28Z</app:edited>
    <link rel=quot;editquot; href=quot;http://www.verbosemode.com/wp-app.php/post/3quot;/>
    <app:control><app:draft>no</app:draft></app:control>
    ...


David Calavera                                           Conferencia Rails 2007
atomPub:collection
<?xml version=quot;1.0quot; encoding=quot;utf-8quot;?>
<feed xmlns=quot;http://www.w3.org/2005/Atomquot;
    xmlns:app=quot;http://www.w3.org/2007/appquot; xml:lang=quot;enquot;>
  <id>http://www.verbosemode.com/wp-app.php/posts</id>
  <updated>2007-11-04T11:38:28Z</updated>
  <title type=quot;textquot;>Verbose mode</title>
  <link rel=quot;firstquot; href=quot;http://www.verbosemode.com/wp-app.php/postsquot;/>
  <link rel=quot;lastquot; href=quot;http://www.verbosemode.com/wp-app.php/postsquot;/>
  <link rel=quot;selfquot; href=quot;http://www.verbosemode.com/wp-app.php/postsquot;/>
  <entry>
    <id>http://www.verbosemode.com/?p=3</id>
    <title type=quot;textquot;>Spanish Rails Conf 07</title>
    <app:edited>2007-11-04T11:38:28Z</app:edited>
    <link rel=quot;editquot; href=quot;http://www.verbosemode.com/wp-app.php/post/3quot;/>
    <app:control><app:draft>no</app:draft></app:control>
    ...


David Calavera                                           Conferencia Rails 2007
atomPub:entry

      PUT 'http://www.verbosemode.com/wp-app.php/post/3'
      HTTP/1.1 204 No Content
      Content-Type: application/atom+xml;type=entry



      DELETE 'http://www.verbosemode.com/wp-app.php/post/3'
      HTTP/1.1 200 OK



      GET 'http://www.verbosemode.com/wp-app.php/post/3'
      HTTP/1.1 200 OK




David Calavera                                             Conferencia Rails 2007
atomPub:entry
<?xml version=quot;1.0quot; encoding=quot;utf-8quot;?>
<entry xmlns=quot;http://www.w3.org/2005/Atomquot;
    xmlns:app=quot;http://www.w3.org/2007/appquot; xml:lang=quot;enquot;>
  <id>http://www.verbosemode.com/?p=3</id>
  <title type=quot;textquot;>Spanish Rails Conf 07</title>
  <updated>2007-11-04T15:43:49Z</updated>
  <published>2007-11-04T11:38:28Z</published>
  <app:edited>2007-11-04T15:43:49Z</app:edited>
  <app:control><app:draft>no</app:draft></app:control>
  <author><name>david</name></author>
  <content type=quot;xhtmlquot;><div xmlns='http://www.w3.org/1999/xhtml'>
      Next November 22 and 23 I'm going to attend to ...</div></content>
  <link rel=quot;editquot; href=quot;http://www.verbosemode.com/wp-app.php/post/3quot; />
  <category scheme=quot;http://www.verbosemode.comquot; term=quot;atomPubquot; />
  <category scheme=quot;http://www.verbosemode.comquot; term=quot;railsquot; />
  <summary type=quot;textquot;>Next November 22 and 23 I&#8217;m ...</summary>
</entry>


David Calavera                                          Conferencia Rails 2007
atomPub:entry
                 ¿y... qué pasa con los otros tipos de recursos?

<entry xmlns=quot;http://www.w3.org/2005/Atomquot;
    xmlns:app=quot;http://www.w3.org/2007/appquot; xml:lang=quot;enquot;>
  <id>http://www.verbosemode.com/wp-content/uploads/2007/11/avatar.png</id>
  <title type=quot;textquot;>avatar poster</title>
  <updated>2007-11-13T21:59:55Z</updated>
  <published>2007-11-13T21:59:55Z</published>
  <app:edited>2007-11-13T21:59:55Z</app:edited>
  <app:control><app:draft>no</app:draft></app:control>
  <author><name>david</name></author>
  <link rel=quot;edit-mediaquot;
    href=quot;http://www.verbosemode.com/wp-app.php/attachment/file/4quot; />
  <link rel=quot;editquot; href=quot;http://www.verbosemode.com/wp-app.php/post/4quot; />
  <content type=quot;image/pngquot;
    src=quot;http://www.verbosemode.com/wp-content/uploads/2007/11/avatar.pngquot;/>
</entry>


David Calavera                                          Conferencia Rails 2007
atomPub:entry
                 ¿y... qué pasa con los otros tipos de recursos?


      PUT 'http://www.verbosemode.com/wp-app.php/attachment/file/4'
      HTTP/1.1 204 No Content
      Content-Type: */*



      DELETE 'http://www.verbosemode.com/wp-app.php/attachment/file/4'
      HTTP/1.1 200 OK



      GET 'http://www.verbosemode.com/wp-app.php/attachment/file/4'
      HTTP/1.1 200 OK




David Calavera                                            Conferencia Rails 2007
atomPub
¿pero... hay gente que usa esto?
๏ google: gdata, youtube, openSocial




David Calavera                    Conferencia Rails 2007
• google: gdata, youtube, openSocial
   ๏ microsoft: windows live writer




David Calavera                     Conferencia Rails 2007
• google: gdata, youtube, openSocial
   • microsoft: windows live writer
   ๏ ibm: lotus connections




David Calavera                     Conferencia Rails 2007
• google: gdata, youtube, openSocial
   • microsoft: windows live writer
   • ibm: lotus connections
   ๏ wordpress




David Calavera                     Conferencia Rails 2007
• google: gdata, youtube, openSocial
   • microsoft: windows live writer
   • ibm: lotus connections
   • wordpress
   ๏ nokia: liveblog



David Calavera                     Conferencia Rails 2007
• google: gdata, youtube, openSocial
   • microsoft: windows live writer
   • ibm: lotus connections
   • wordpress
   • nokia: liveblog
   ๏ six apart: typepad, movable type


David Calavera                     Conferencia Rails 2007
• google: gdata, youtube, openSocial
• microsoft: windows live writer
• ibm: lotus connections
• wordpress
• nokia: liveblog
• six apart: typepad, movable type
๏ 11870.com
ruby
sin más
Net::HTTP




David Calavera   Conferencia Rails 2007
Net::HTTP

   ๏ fácil de mantener




David Calavera           Conferencia Rails 2007
Net::HTTP

   • fácil de mantener
   ๏ respuesta condicionada al estado




David Calavera                    Conferencia Rails 2007
HTTPResponse
                       HTTPSuccess                    # 2xx
                           HTTPOK                         #   200
                           HTTPCreated                    #   201
                       HTTPRedirection                # 3xx
                           HTTPNotModified                #   304
                       HTTPClientError                # 4xx
                           HTTPBadRequest                 #   400
                           HTTPUnauthorized               #   401
                           HTTPForbidden                  #   403
                           HTTPNotFound                   #   404
                           HTTPPreconditionFailed         #   412
                           HTTPUnsupportedMediaType       #   415
                       HTTPServerError                # 5xx
                           HTTPInternalServerError        #   500




David Calavera                                            Conferencia Rails 2007
Net:HTTP

   • fácil de mantener
   • respuesta condicionada al estado
   ๏ no sabe si estoy en una capa segura



David Calavera                    Conferencia Rails 2007
require 'net/http'
                 require 'net/https'

                 @uri = 'https://registro.conferenciarails.org'
                 http = Net::HTTP.new @uri
                 http.use_ssl = true if @uri =~ /^https/




David Calavera                                              Conferencia Rails 2007
los cuatro verbos http
           Net::HTTP.start(@uri.host, @uri.port) do |http|
           end




David Calavera                                         Conferencia Rails 2007
los cuatro verbos http
           Net::HTTP.start(@uri.host, @uri.port) do |http|
             #POST
             http.request Net::HTTP::Post.new(@uri.path), data
           end




David Calavera                                         Conferencia Rails 2007
los cuatro verbos http
           Net::HTTP.start(@uri.host, @uri.port) do |http|
             #POST
             http.request Net::HTTP::Post.new(@uri.path), data
             #GET
             http.request Net::HTTP::Get.new(@uri.path)
           end




David Calavera                                         Conferencia Rails 2007
los cuatro verbos http
           Net::HTTP.start(@uri.host, @uri.port) do |http|
             #POST
             http.request Net::HTTP::Post.new(@uri.path), data
             #GET
             http.request Net::HTTP::Get.new(@uri.path)
             #PUT
             http.request Net::HTTP::Put.new(@uri.path), data
           end




David Calavera                                         Conferencia Rails 2007
los cuatro verbos http
           Net::HTTP.start(@uri.host, @uri.port) do |http|
             #POST
             http.request Net::HTTP::Post.new(@uri.path), data
             #GET
             http.request Net::HTTP::Get.new(@uri.path)
             #PUT
             http.request Net::HTTP::Put.new(@uri.path), data
             #DELETE
             http.request Net::HTTP::Delete.new(@uri.path)
           end




David Calavera                                         Conferencia Rails 2007
REXML

   ๏ parser completo




David Calavera         Conferencia Rails 2007
REXML

   • parser completo
   ๏ escrito completamente en ruby




David Calavera                       Conferencia Rails 2007
REXML

   • parser completo
   • escrito completamente en ruby
   ๏ pasa los test de aceptación de Oasis



David Calavera                     Conferencia Rails 2007
REXML

   • parser completo
   • escrito completamente en ruby
   • pasa los test de aceptación de Oasis
   ๏ soporta XPath


David Calavera                      Conferencia Rails 2007
REXML y xpath
      NS = {'atom' => 'http://www.w3.org/2005/Atom',
        'app' => 'http://www.w3.org/2007/app',
        'georss' => 'http://www.georss.org/georss/10',
        'gml' => 'http://www.opengis.net/gml'
      }

      REXML::XPath.each( feed.root, './atom:entry', NS) do |entry|
        title = REXML::XPath.first(entry,
          './atom:title/text()', NS)
        edited = REXML::XPath.first(entry,
          './app:edited/text()', NS)
        pos = REXML::XPath.first(entry,
          './georss:where/gml:Point/gml:pos/text()', NS)
      end




David Calavera                                            Conferencia Rails 2007
REXML y xpath
      NS = {'atom' => 'http://www.w3.org/2005/Atom',
        'app' => 'http://www.w3.org/2007/app',
        'georss' => 'http://www.georss.org/georss/10',
        'gml' => 'http://www.opengis.net/gml'
      }

      REXML::XPath.each( feed.root, './atom:entry', NS) do |entry|
        title = REXML::XPath.first(entry,
          './atom:title/text()', NS)
        edited = REXML::XPath.first(entry,
          './app:edited/text()', NS)
        pos = REXML::XPath.first(entry,
          './georss:where/gml:Point/gml:pos/text()', NS)
      end




David Calavera                                            Conferencia Rails 2007
REXML y xpath
      NS = {'atom' => 'http://www.w3.org/2005/Atom',
        'app' => 'http://www.w3.org/2007/app',
        'georss' => 'http://www.georss.org/georss/10',
        'gml' => 'http://www.opengis.net/gml'
      }

      REXML::XPath.each( feed.root, './atom:entry', NS) do |entry|
        title = REXML::XPath.first(entry,
          './atom:title/text()', NS)
        edited = REXML::XPath.first(entry,
          './app:edited/text()', NS)
        pos = REXML::XPath.first(entry,
          './georss:where/gml:Point/gml:pos/text()', NS)
      end




David Calavera                                            Conferencia Rails 2007
REXML y xpath
      NS = {'atom' => 'http://www.w3.org/2005/Atom',
        'app' => 'http://www.w3.org/2007/app',
        'georss' => 'http://www.georss.org/georss/10',
        'gml' => 'http://www.opengis.net/gml'
      }

      REXML::XPath.each( feed.root, './atom:entry', NS) do |entry|
        title = REXML::XPath.first(entry,
          './atom:title/text()', NS)
        edited = REXML::XPath.first(entry,
          './app:edited/text()', NS)
        pos = REXML::XPath.first(entry,
          './georss:where/gml:Point/gml:pos/text()', NS)
      end




David Calavera                                            Conferencia Rails 2007
REXML y xpath
      NS = {'atom' => 'http://www.w3.org/2005/Atom',
        'app' => 'http://www.w3.org/2007/app',
        'georss' => 'http://www.georss.org/georss/10',
        'gml' => 'http://www.opengis.net/gml'
      }

      REXML::XPath.each( feed.root, './atom:entry', NS) do |entry|
        title = REXML::XPath.first(entry,
          './atom:title/text()', NS)
        edited = REXML::XPath.first(entry,
          './app:edited/text()', NS)
        pos = REXML::XPath.first(entry,
          './georss:where/gml:Point/gml:pos/text()', NS)
      end




David Calavera                                            Conferencia Rails 2007
Builder

   ๏ crea xml fácilmente




David Calavera             Conferencia Rails 2007
require 'builder'

builder = Builder::XmlMarkup.new

xml = builder.feed( 'xmlns' => 'http://www.w3.org/2005/Atom' ) do |feed|
  feed.id 'http://conferenciarails.org/atomPub'
  feed.updated Time.now
  feed.author do |author| author.name 'David Calavera' end

  feed.entry do |entry|
    entry.title 'entrada para la conferencia rails'
  end
end




David Calavera                                          Conferencia Rails 2007
Builder

   • crea xml fácilmente
   ๏ no solo se usa con rails




David Calavera                  Conferencia Rails 2007
๏ in the beginning... was the command line
        builder = Builder::XmlMarkup.new(:target=>STDOUT, :indent=>2)




David Calavera                                            Conferencia Rails 2007
• in the beginning... was the command line
        builder = Builder::XmlMarkup.new(:target=>STDOUT, :indent=>2)




 ๏ vamos de camping
        Camping.goes :Atom
        module Atom::Views
          def index
            html do
              head do
                title 'Atom Publishing Protocol @ conferecia rails'
              end
              body do ... end
          end
        end

David Calavera                                            Conferencia Rails 2007
ruby
extras
atom-tools
                 http://code.necronomicorp.com/atom-tools


   ๏ parsea y manipula feeds




David Calavera                                     Conferencia Rails 2007
atom-tools
                 http://code.necronomicorp.com/atom-tools


   • parsea y manipula feeds
   ๏ adaptado al rfc 5023




David Calavera                                     Conferencia Rails 2007
atom-tools
                 http://code.necronomicorp.com/atom-tools


   • parsea y manipula feeds
   • adaptado al rfc 5023
   ๏ abstracción de http y xml



David Calavera                                     Conferencia Rails 2007
require 'atom-tools'

                 http = Atom::HTTP.new
                 http.user = 'david'
                 http.pass = 'my password'
                 http.always_auth :basic

                 service = Atom::Service.new
                   'http://verbosemode.com/wp-app.php/service', http

                 service.collections.each do |collection|
                   puts collection.accepts
                 end




David Calavera                                                 Conferencia Rails 2007
require 'atom-tools'

                 http = Atom::HTTP.new
                 http.user = 'david'
                 http.pass = 'my password'
                 http.always_auth :basic

                 service = Atom::Service.new
                   'http://verbosemode.com/wp-app.php/service', http

                 service.collections.each do |collection|
                   puts collection.accepts
                 end




David Calavera                                                 Conferencia Rails 2007
require 'atom-tools'

                 http = Atom::HTTP.new
                 http.user = 'david'
                 http.pass = 'my password'
                 http.always_auth :basic

                 service = Atom::Service.new
                   'http://verbosemode.com/wp-app.php/service', http

                 service.collections.each do |collection|
                   puts collection.accepts
                 end




David Calavera                                                 Conferencia Rails 2007
atom_pub_server
    http://svn.thinkincode.net/rails/plugins/atom_pub_server


   ๏ rails es REST




David Calavera                               Conferencia Rails 2007
atom_pub_server
    http://svn.thinkincode.net/rails/plugins/atom_pub_server


   • rails es REST
   ๏ mejor soporte para atom y atomPub




David Calavera                               Conferencia Rails 2007
atom_feed do |feed|
  feed.title(quot;My great blog!quot;)
  feed.updated((@posts.first.created_at))

  for post in @posts
    feed.entry(post) do |entry|
      entry.tag!('georss:where',
          'xmlns:georss' => 'http://www.georss.org/georss/10') do |where|
        where.tag!('gml:Poing',
            'xmlns:gml' => 'http://www.opengis.net/gml') do |point|
          point.tag!('gml:pos', nil, '40.419967 -3.698965')
        end
      end




David Calavera                                          Conferencia Rails 2007
atom_feed({'xmlns:georss' => 'http://www.georss.org/georss/10',
         'xmlns:gml' => 'http://www.opengis.net/gml'}) do |feed|
       feed.title(quot;My great blog!quot;)
       feed.updated((@posts.first.created_at))

        for post in @posts
          feed.entry(post) do |entry|
            entry.georss:where do |where|
              where.gml:Point do |point|
                point.tag!('gml:pos', '40.419967 -3.698965')
              end
            end




David Calavera                                            Conferencia Rails 2007
atom_pub_server
    http://svn.thinkincode.net/rails/plugins/atom_pub_server


   • rails es REST
   • mejor soporte para atom y atomPub
   ๏ acts_as_collection



David Calavera                               Conferencia Rails 2007
class PostsController < ApplicationController
      acts_as_collection :title => 'Posts', :workspace => 'Blog',
        :accept => Mime::ATOM_ENTRY,
        :href => 'http::/verbosemode.com/atomPub/posts',
        :categories => [
          {
             :fixed => 'yes', :scheme => 'http://verbosemode.com/tags',
             :category => [{:term => 'rails'}, {:term => 'plugins'}]
          },
          {:href => 'http://verbosemode.com/mysections'}
        ]
    end




David Calavera                                            Conferencia Rails 2007
atom_pub_server
    http://svn.thinkincode.net/rails/plugins/atom_pub_server


   • rails es REST
   • mejor soporte para atom y atomPub
   • acts_as_collection
   ๏ acts_as_service_document


David Calavera                               Conferencia Rails 2007
class ServicesController < ApplicationController
                   acts_as_service_document

                   def index
                     render :xml => service_document
                   end
                 end




David Calavera                                               Conferencia Rails 2007
the ape
    http://www.tbray.org/ape


๏ the atom publishing exerciser
the ape
                 http://www.tbray.org/ape


   • the atom publishing exerciser
   ๏ introspección!!!




David Calavera                              Conferencia Rails 2007
David Calavera   Conferencia Rails 2007
the ape
                 http://www.tbray.org/ape


   • the atom publishing exerciser
   • introspección!!!
   ๏ varios sistemas de autenticación



David Calavera                              Conferencia Rails 2007
David Calavera   Conferencia Rails 2007
the ape
                 http://www.tbray.org/ape


   • the atom publishing exerciser
   • introspección!!!
   • varios sistemas de autenticación
   ๏ no es muy fácil de instalar (de momento)


David Calavera                              Conferencia Rails 2007
the ape
                 http://www.tbray.org/ape


   • the atom publishing exerciser
   • introspección!!!
   • varios sistemas de autenticación
   • no es muy fácil de instalar (de momento)
   ๏ no es muy fácil de configurar (de momento)

David Calavera                              Conferencia Rails 2007
la api de 11870.com
    http://11870.com/api
por partes

   ๏ api de búsqueda
      ➡ formato openSearch (http://opensearch.org)




David Calavera                         Conferencia Rails 2007
<?xml version=quot; 1.0quot; encoding=quot;UTF-8quot;?>
  <service xmlns:atom=quot;http://www.w3.org/2005/Atomquot;
      xmlns=quot;http://www.w3.org/2007/app quot; xml:base=quot;http://11870.com/quot;>
    <workspace>
      <atom:title type=quot;textquot;>11870 workspace</atom:title>
      <collection href=quot;/api/v1/searchquot;>
        <atom:title type=quot;textquot;>Search</atom:title>
      </collection>
    </workspace>
  </service>




David Calavera                                          Conferencia Rails 2007
por partes

   • api de búsqueda
   ๏ api de gestión de contenidos




David Calavera                      Conferencia Rails 2007
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
      <service xmlns:atom=quot;http://www.w3.org/2005/Atomquot; xmlns=quot; http://www.w3.org/2007/appquot;
      xml:base=quot;http://localhost/quot;>
        <workspace>
          <atom:title type=quot;textquot;>11870 workspace</atom:title>
          <collection href=quot;/api/v1/sites/calaveraquot;>
            <atom:title type=quot;textquot;>Sites</atom:title>
            <accept>application/atom+xml;type=entry</accept>
            <categories xmlns:oos=quot;http://11870.com/api/oos quot;
                   href=quot;http://localhost/api/v1/lists/calaveraquot; oos:label=quot;listsquot;/>
            <categories xmlns:oos=quot; http://11870.com/api/oosquot;
                   href=quot;http://localhost/api/v1/tags/calaveraquot; oos:label=quot;tagsquot;/>
            <categories xmlns:oos=quot; http://11870.com/api/oosquot;
                   href=quot;http://localhost/api/v1/privacyquot; oos:label=quot;privacyquot;/>
          </collection>
          <collection href=quot;/api/v1/contacts/calaveraquot;>
            <atom:title type=quot;textquot;>Contacts</atom:title>
            <accept>application/atom+xml;type=entry</accept>
            <categories xmlns:oos=quot; http://11870.com/api/oosquot;
                   href=quot;http://localhost/api/v1/trustedquot; oos:label=quot;trustedquot;/>
          </collection>
          <collection href=quot;/api/v1/usersquot;>
            <atom:title type=quot;textquot;>Users</atom:title>
            <accept>image/*</accept>
            <accept>application/atom+xml;type=entry</accept>
          </collection>
          <collection href=quot;/api/v1/searchquot;>
            <atom:title type=quot;textquot;>Search</atom:title>
          </collection>
        </workspace>
      </service>



David Calavera                                                              Conferencia Rails 2007
más allá de atomPub

   ๏ sintaxis




David Calavera   Conferencia Rails 2007
<entry xmlns:app=quot;http://www.w3.org/2007/appquot;
           xmlns:oos=quot;http://11870.com/api/oosquot;
           xmlns:georss=quot;http://www.georss.org/georss/10quot;
           xmlns=quot;http://www.w3.org/2005/Atomquot; xml:lang=quot;enquot;>
         <id>http://11870.com/pro/23474/calavera</id>
         <title type=quot;textquot;>Apple Store Fifth Avenue</title>
         <oos:useraddress>767 5th Avenue</oos:useraddress>
         <oos:url>http://www.apple.com/retail/fifthavenue</oos:url>
         <oos:telephone>+1 212 3361440</oos:telephone>
         <oos:locality slug=quot;/us/new-yorkquot;>New York</oos:locality>
         <oos:country slug=quot;/usquot;>United States</oos:country>




David Calavera                                           Conferencia Rails 2007
más allá de atomPub

   • sintaxis
   ๏ autenticación




David Calavera       Conferencia Rails 2007
más allá de atomPub

   • sintaxis
   ๏ autenticación
        ➡ identificar aplicaciones



David Calavera                       Conferencia Rails 2007
Net::HTTP.start( '11870.com' ) do |http|
  req = Net::HTTP::Get.new('/api/v1')
  req['appToken'] = 'el app token que 11870 te ha asignado'
  digest = Digest::MD5.hexdigest(quot;#{req['appToken']}#{la clave secreta}quot;)
  req['authSign'] = digest
  http.request req
end




David Calavera                                          Conferencia Rails 2007
más allá de atomPub

   • sintaxis
   ๏ autenticación
        ➡ identificar aplicaciones
        ➡ autenticar usuarios


David Calavera                       Conferencia Rails 2007
request['Authorization'] = 'WSSE profile=quot;UsernameTokenquot;'
request['X-WSSE'] = wsse!

def wsse!

  nonce = Array.new(10){ rand(0x1000000) }.pack('I*')
  nonce_b64 = [nonce].pack(quot;mquot;).chomp
  now = Time.now.gmtime.strftime(quot;%FT%TZquot;)
  digest = [Digest::SHA1.digest(nonce_b64 + now + @password)].pack(quot;mquot;).chomp

  %Q<UsernameToken Username=quot;#{@username}quot;,
      PasswordDigest=quot;#{digest}quot;, Nonce=quot;#{nonce_b64}quot;, Created=quot;#{now}quot;>
end




  David Calavera                                            Conferencia Rails 2007
más allá de atomPub

   • sintaxis
   ๏ autenticación
        ➡ identificar aplicaciones
        ➡ autenticar usuarios
        ➡ evolucionará a OAuth (http://oauth.net)

David Calavera                           Conferencia Rails 2007
más allá de atomPub

   • sintaxis
   • autenticación
   ๏ múltiples representaciones



David Calavera                    Conferencia Rails 2007
{
           quot;idquot;:quot;/api/v1/sites/calaveraquot;,
           quot;titlequot;:quot;Sitesquot;,
           quot;updatedquot;:quot;2007-09-28T07:53:46.000Zquot;,
           quot;authorsquot;:[{
              quot;namequot;:quot;calaveraquot;
            }
           ],
           quot;linksquot;:[{
              quot;hrefquot;:quot;http://11870.com/api/v1/sites/calaveraquot;,
              quot;relquot;:quot;selfquot;
            },{
              quot;hrefquot;:quot;http://11870.com/api/v1/sites/calavera?page=2quot;,
              quot;relquot;:quot;nextquot;
            }
           ],
           quot;entriesquot;:[{
              quot;langquot;:quot;esquot;,
              quot;idquot;:quot;http://11870.com/pro/23474/calaveraquot;,
              quot;titlequot;:quot;Apple Store Fifth Avenuequot;,
              quot;summaryquot;:quot;en directoquot;,
              quot;contentquot;:quot;estoy ahora mismo en esta...


David Calavera                                              Conferencia Rails 2007
más allá de atomPub

   • sintaxis
   • autenticación
   • múltiples representaciones
   ๏ control de versiones


David Calavera                    Conferencia Rails 2007
๏ ahora
                 Net::HTTP.start( '11870.com' ) do |http|
                   http.request Net::HTTP::Get.new('/api/v1')
                 end




David Calavera                                             Conferencia Rails 2007
• ahora
                 Net::HTTP.start( '11870.com' ) do |http|
                   http.request Net::HTTP::Get.new('/api/v1')
                 end




    ๏ en un futuro
                 Net::HTTP.start( '11870.com' ) do |http|
                   http.request Net::HTTP::Get.new('/api/v1.5')
                 end




David Calavera                                             Conferencia Rails 2007
más allá de atomPub

   • sintaxis
   • autenticación
   • múltiples representaciones
   • control de versiones
   ๏ soporte de librerías

David Calavera                    Conferencia Rails 2007
http://code.google.com/p/api-11870/




David Calavera                         Conferencia Rails 2007
más allá de atomPub

   • sintaxis
   • autenticación
   • múltiples representaciones
   • control de versiones
   • soporte de librerías
   ๏ ¡documentación!
David Calavera                    Conferencia Rails 2007
http://groups.google.com/group/api-11870




David Calavera                     Conferencia Rails 2007
la api de 11870.com
       oos4ruby
búsqueda
require 'oos4ruby'

oos = Oos.new
oos.auth_app 'appToken', 'secretKey'

oos.search q => 'apple store in new york'

oos.search bbox => ['SOUTH', 'WEST', 'NORTH', 'EAST']

oos.search lat => 'LATITUDE', lon => 'LONGITUDE', radius => '3000 METRES'

oos.search tags => ['restaurant', 'cheap', 'clean']




David Calavera                                          Conferencia Rails 2007
búsqueda
require 'oos4ruby'

oos = Oos.new
oos.auth_app 'appToken', 'secretKey'

oos.search q => 'apple store in new york'

oos.search bbox => ['SOUTH', 'WEST', 'NORTH', 'EAST']

oos.search lat => 'LATITUDE', lon => 'LONGITUDE', radius => '3000 METRES'

oos.search tags => ['restaurant', 'cheap', 'clean']




David Calavera                                          Conferencia Rails 2007
búsqueda
require 'oos4ruby'

oos = Oos.new
oos.auth_app 'appToken', 'secretKey'

oos.search q => 'apple store in new york'

oos.search bbox => ['SOUTH', 'WEST', 'NORTH', 'EAST']

oos.search lat => 'LATITUDE', lon => 'LONGITUDE', radius => '3000 METRES'

oos.search tags => ['restaurant', 'cheap', 'clean']




David Calavera                                          Conferencia Rails 2007
búsqueda
require 'oos4ruby'

oos = Oos.new
oos.auth_app 'appToken', 'secretKey'

oos.search q => 'apple store in new york'

oos.search bbox => ['SOUTH', 'WEST', 'NORTH', 'EAST']

oos.search lat => 'LATITUDE', lon => 'LONGITUDE', radius => '3000 METRES'

oos.search tags => ['restaurant', 'cheap', 'clean']




David Calavera                                          Conferencia Rails 2007
búsqueda
require 'oos4ruby'

oos = Oos.new
oos.auth_app 'appToken', 'secretKey'

oos.search q => 'apple store in new york'

oos.search bbox => ['SOUTH', 'WEST', 'NORTH', 'EAST']

oos.search lat => 'LATITUDE', lon => 'LONGITUDE', radius => '3000 METRES'

oos.search tags => ['restaurant', 'cheap', 'clean']




David Calavera                                          Conferencia Rails 2007
gestión
        require 'oos4ruby'

        oos = Oos.new
        oos.auth_user 'user email', 'auth token'

        user = oos.user
        user.sites.each do |pro|
          unless pro.multimedia.empty?
            pro.multimedia.each do |media|
              puts media.type
              puts media.src
            end
          end
        end

        user.contacts.create! :slug => 'calavera', :trusted => 'true'

        user.update_avatar! '/Users/david/skull.png'


David Calavera                                            Conferencia Rails 2007
gestión
        require 'oos4ruby'

        oos = Oos.new
        oos.auth_user 'user email', 'auth token'

        user = oos.user
        user.sites.each do |pro|
          unless pro.multimedia.empty?
            pro.multimedia.each do |media|
              puts media.type
              puts media.src
            end
          end
        end

        user.contacts.create! :slug => 'calavera', :trusted => 'true'

        user.update_avatar! '/Users/david/skull.png'


David Calavera                                            Conferencia Rails 2007
gestión
        require 'oos4ruby'

        oos = Oos.new
        oos.auth_user 'user email', 'auth token'

        user = oos.user
        user.sites.each do |pro|
          unless pro.multimedia.empty?
            pro.multimedia.each do |media|
              puts media.type
              puts media.src
            end
          end
        end

        user.contacts.create! :slug => 'calavera', :trusted => 'true'

        user.update_avatar! '/Users/david/skull.png'


David Calavera                                            Conferencia Rails 2007
gestión
        require 'oos4ruby'

        oos = Oos.new
        oos.auth_user 'user email', 'auth token'

        user = oos.user
        user.sites.each do |pro|
          unless pro.multimedia.empty?
            pro.multimedia.each do |media|
              puts media.type
              puts media.src
            end
          end
        end

        user.contacts.create! :slug => 'calavera', :trusted => 'true'

        user.update_avatar! '/Users/david/skull.png'


David Calavera                                            Conferencia Rails 2007
¿...?
muchas gracias
 http://thinkincode.net

More Related Content

What's hot

手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務Mu Chun Wang
 
Simple SQL Change Management with Sqitch
Simple SQL Change Management with SqitchSimple SQL Change Management with Sqitch
Simple SQL Change Management with SqitchDavid Wheeler
 
Sane SQL Change Management with Sqitch
Sane SQL Change Management with SqitchSane SQL Change Management with Sqitch
Sane SQL Change Management with SqitchDavid Wheeler
 
What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5Darren Craig
 
Automatisation in development and testing - within budget
Automatisation in development and testing - within budgetAutomatisation in development and testing - within budget
Automatisation in development and testing - within budgetDavid Lukac
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API07.pallav
 
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
Adventures in Laravel 5 SunshinePHP 2016 TutorialAdventures in Laravel 5 SunshinePHP 2016 Tutorial
Adventures in Laravel 5 SunshinePHP 2016 TutorialJoe Ferguson
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionJoe Ferguson
 
All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$Joe Ferguson
 
Getting to know Laravel 5
Getting to know Laravel 5Getting to know Laravel 5
Getting to know Laravel 5Bukhori Aqid
 
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
[Community Open Camp] 給 PHP 開發者的 VS Code 指南[Community Open Camp] 給 PHP 開發者的 VS Code 指南
[Community Open Camp] 給 PHP 開發者的 VS Code 指南Shengyou Fan
 
Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021Matt Raible
 
Digpen 7: Why choose Laravel?
Digpen 7: Why choose Laravel?Digpen 7: Why choose Laravel?
Digpen 7: Why choose Laravel?John Blackmore
 
Baremetal deployment scale
Baremetal deployment scaleBaremetal deployment scale
Baremetal deployment scalebaremetal
 
Baremetal deployment
Baremetal deploymentBaremetal deployment
Baremetal deploymentbaremetal
 
Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)Viral Solani
 
Hosting Your Own OTA Update Service
Hosting Your Own OTA Update ServiceHosting Your Own OTA Update Service
Hosting Your Own OTA Update ServiceQuinlan Jung
 

What's hot (20)

手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務
 
The State of Wicket
The State of WicketThe State of Wicket
The State of Wicket
 
Why Laravel?
Why Laravel?Why Laravel?
Why Laravel?
 
Simple SQL Change Management with Sqitch
Simple SQL Change Management with SqitchSimple SQL Change Management with Sqitch
Simple SQL Change Management with Sqitch
 
Sane SQL Change Management with Sqitch
Sane SQL Change Management with SqitchSane SQL Change Management with Sqitch
Sane SQL Change Management with Sqitch
 
What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5
 
Automatisation in development and testing - within budget
Automatisation in development and testing - within budgetAutomatisation in development and testing - within budget
Automatisation in development and testing - within budget
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
 
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
Adventures in Laravel 5 SunshinePHP 2016 TutorialAdventures in Laravel 5 SunshinePHP 2016 Tutorial
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 
All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$
 
Getting to know Laravel 5
Getting to know Laravel 5Getting to know Laravel 5
Getting to know Laravel 5
 
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
[Community Open Camp] 給 PHP 開發者的 VS Code 指南[Community Open Camp] 給 PHP 開發者的 VS Code 指南
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
 
Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021
 
How Flipkart scales PHP
How Flipkart scales PHPHow Flipkart scales PHP
How Flipkart scales PHP
 
Digpen 7: Why choose Laravel?
Digpen 7: Why choose Laravel?Digpen 7: Why choose Laravel?
Digpen 7: Why choose Laravel?
 
Baremetal deployment scale
Baremetal deployment scaleBaremetal deployment scale
Baremetal deployment scale
 
Baremetal deployment
Baremetal deploymentBaremetal deployment
Baremetal deployment
 
Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)
 
Hosting Your Own OTA Update Service
Hosting Your Own OTA Update ServiceHosting Your Own OTA Update Service
Hosting Your Own OTA Update Service
 

Viewers also liked

Heiligverklaring Van Mijn Moeder
Heiligverklaring Van Mijn MoederHeiligverklaring Van Mijn Moeder
Heiligverklaring Van Mijn Moederguesta65a9f
 
New Years Day Final
New Years Day FinalNew Years Day Final
New Years Day Finaldiscover5
 
La fabrica de chocolate
La fabrica de chocolateLa fabrica de chocolate
La fabrica de chocolateguest0d8255
 
Congreso cine Piura
Congreso cine PiuraCongreso cine Piura
Congreso cine PiuraAbel Suing
 
Santarus
SantarusSantarus
SantarusMuslim
 
Lenins Significance Template
Lenins Significance TemplateLenins Significance Template
Lenins Significance Templatehistory1
 
Konsep pendidikan islam
Konsep pendidikan islamKonsep pendidikan islam
Konsep pendidikan islamDozzo Morini
 
Libro de Ciencias Naturales Quinto Grado
Libro de Ciencias Naturales Quinto GradoLibro de Ciencias Naturales Quinto Grado
Libro de Ciencias Naturales Quinto GradoVic Mendoza
 
Observatorio de Medios
Observatorio de MediosObservatorio de Medios
Observatorio de MediosSvet Ivantchev
 

Viewers also liked (11)

Life & Passsion
Life & PasssionLife & Passsion
Life & Passsion
 
Heiligverklaring Van Mijn Moeder
Heiligverklaring Van Mijn MoederHeiligverklaring Van Mijn Moeder
Heiligverklaring Van Mijn Moeder
 
New Years Day Final
New Years Day FinalNew Years Day Final
New Years Day Final
 
La fabrica de chocolate
La fabrica de chocolateLa fabrica de chocolate
La fabrica de chocolate
 
Congreso cine Piura
Congreso cine PiuraCongreso cine Piura
Congreso cine Piura
 
Santarus
SantarusSantarus
Santarus
 
Lenins Significance Template
Lenins Significance TemplateLenins Significance Template
Lenins Significance Template
 
Konsep pendidikan islam
Konsep pendidikan islamKonsep pendidikan islam
Konsep pendidikan islam
 
Libro de Ciencias Naturales Quinto Grado
Libro de Ciencias Naturales Quinto GradoLibro de Ciencias Naturales Quinto Grado
Libro de Ciencias Naturales Quinto Grado
 
Observatorio de Medios
Observatorio de MediosObservatorio de Medios
Observatorio de Medios
 
OswaldoProfile
OswaldoProfileOswaldoProfile
OswaldoProfile
 

Similar to atomPub, ruby y la api de 11870

Adriano Di Luzio - Davvy - PyconSEI Talk
Adriano Di Luzio - Davvy - PyconSEI TalkAdriano Di Luzio - Davvy - PyconSEI Talk
Adriano Di Luzio - Davvy - PyconSEI Talkaldur999
 
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com RubyFisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com RubyFabio Akita
 
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
 
Spring into rails
Spring into railsSpring into rails
Spring into railsHiro Asari
 
Deploy Rails Application by Capistrano
Deploy Rails Application by CapistranoDeploy Rails Application by Capistrano
Deploy Rails Application by CapistranoTasawr Interactive
 
Developing Web Services from Scratch - For DBAs and Database Developers
Developing Web Services from Scratch - For DBAs and Database DevelopersDeveloping Web Services from Scratch - For DBAs and Database Developers
Developing Web Services from Scratch - For DBAs and Database DevelopersRevelation Technologies
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - DeploymentFabio Akita
 
HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?Alessandro Nadalin
 
Wicket Deliver Your Webapp On Time
Wicket Deliver Your Webapp On TimeWicket Deliver Your Webapp On Time
Wicket Deliver Your Webapp On TimeWill Hoover
 
The A to Z of developing for the web
The A to Z of developing for the webThe A to Z of developing for the web
The A to Z of developing for the webMatt Wood
 
前瞻性Web性能优化pwpo
前瞻性Web性能优化pwpo前瞻性Web性能优化pwpo
前瞻性Web性能优化pwpoMichael Zhang
 
Writing highly scalable WebSocket using the Atmosphere Framework and Scala
Writing highly scalable WebSocket using the Atmosphere Framework and ScalaWriting highly scalable WebSocket using the Atmosphere Framework and Scala
Writing highly scalable WebSocket using the Atmosphere Framework and Scalajfarcand
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainKen Collins
 
Socket applications
Socket applicationsSocket applications
Socket applicationsJoão Moura
 
Apache Roller, Acegi Security and Single Sign-on
Apache Roller, Acegi Security and Single Sign-onApache Roller, Acegi Security and Single Sign-on
Apache Roller, Acegi Security and Single Sign-onMatt Raible
 
Ruby off Rails---rack, sinatra and sequel
Ruby off Rails---rack, sinatra and sequelRuby off Rails---rack, sinatra and sequel
Ruby off Rails---rack, sinatra and sequelJiang Wu
 

Similar to atomPub, ruby y la api de 11870 (20)

Adriano Di Luzio - Davvy - PyconSEI Talk
Adriano Di Luzio - Davvy - PyconSEI TalkAdriano Di Luzio - Davvy - PyconSEI Talk
Adriano Di Luzio - Davvy - PyconSEI Talk
 
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com RubyFisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
 
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
 
Spring into rails
Spring into railsSpring into rails
Spring into rails
 
Deploy Rails Application by Capistrano
Deploy Rails Application by CapistranoDeploy Rails Application by Capistrano
Deploy Rails Application by Capistrano
 
Developing Web Services from Scratch - For DBAs and Database Developers
Developing Web Services from Scratch - For DBAs and Database DevelopersDeveloping Web Services from Scratch - For DBAs and Database Developers
Developing Web Services from Scratch - For DBAs and Database Developers
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
 
HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?
 
Wicket Deliver Your Webapp On Time
Wicket Deliver Your Webapp On TimeWicket Deliver Your Webapp On Time
Wicket Deliver Your Webapp On Time
 
The A to Z of developing for the web
The A to Z of developing for the webThe A to Z of developing for the web
The A to Z of developing for the web
 
Road to Rails
Road to RailsRoad to Rails
Road to Rails
 
前瞻性Web性能优化pwpo
前瞻性Web性能优化pwpo前瞻性Web性能优化pwpo
前瞻性Web性能优化pwpo
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 
Writing highly scalable WebSocket using the Atmosphere Framework and Scala
Writing highly scalable WebSocket using the Atmosphere Framework and ScalaWriting highly scalable WebSocket using the Atmosphere Framework and Scala
Writing highly scalable WebSocket using the Atmosphere Framework and Scala
 
Sinatra
SinatraSinatra
Sinatra
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own Domain
 
Rails 101
Rails 101Rails 101
Rails 101
 
Socket applications
Socket applicationsSocket applications
Socket applications
 
Apache Roller, Acegi Security and Single Sign-on
Apache Roller, Acegi Security and Single Sign-onApache Roller, Acegi Security and Single Sign-on
Apache Roller, Acegi Security and Single Sign-on
 
Ruby off Rails---rack, sinatra and sequel
Ruby off Rails---rack, sinatra and sequelRuby off Rails---rack, sinatra and sequel
Ruby off Rails---rack, sinatra and sequel
 

More from David Calavera

Rubyspec y el largo camino hacia Ruby 1.9
Rubyspec y el largo camino hacia Ruby 1.9Rubyspec y el largo camino hacia Ruby 1.9
Rubyspec y el largo camino hacia Ruby 1.9David Calavera
 
GTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementationGTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementationDavid Calavera
 
Conferencia Rails: Integracion Continua Y Rails
Conferencia Rails: Integracion Continua Y RailsConferencia Rails: Integracion Continua Y Rails
Conferencia Rails: Integracion Continua Y RailsDavid Calavera
 
ApacheCon: Abdera A Java Atom Pub Implementation
ApacheCon: Abdera A Java Atom Pub ImplementationApacheCon: Abdera A Java Atom Pub Implementation
ApacheCon: Abdera A Java Atom Pub ImplementationDavid Calavera
 
Taller sobre la api 11870.com
Taller sobre la api 11870.comTaller sobre la api 11870.com
Taller sobre la api 11870.comDavid Calavera
 

More from David Calavera (8)

Trinidad
TrinidadTrinidad
Trinidad
 
JRuby hacking guide
JRuby hacking guideJRuby hacking guide
JRuby hacking guide
 
My name is Trinidad
My name is TrinidadMy name is Trinidad
My name is Trinidad
 
Rubyspec y el largo camino hacia Ruby 1.9
Rubyspec y el largo camino hacia Ruby 1.9Rubyspec y el largo camino hacia Ruby 1.9
Rubyspec y el largo camino hacia Ruby 1.9
 
GTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementationGTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementation
 
Conferencia Rails: Integracion Continua Y Rails
Conferencia Rails: Integracion Continua Y RailsConferencia Rails: Integracion Continua Y Rails
Conferencia Rails: Integracion Continua Y Rails
 
ApacheCon: Abdera A Java Atom Pub Implementation
ApacheCon: Abdera A Java Atom Pub ImplementationApacheCon: Abdera A Java Atom Pub Implementation
ApacheCon: Abdera A Java Atom Pub Implementation
 
Taller sobre la api 11870.com
Taller sobre la api 11870.comTaller sobre la api 11870.com
Taller sobre la api 11870.com
 

Recently uploaded

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
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
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
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
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
"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
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
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
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
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
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
"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
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
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
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 

atomPub, ruby y la api de 11870

  • 1. Atom Publishing Protocol, ruby y la api de 11870.com David Calavera
  • 3. 11870.com ๏ recuerda y comparte negocios ... David Calavera Conferencia Rails 2007
  • 4. 11870.com • recuerda y comparte negocios ... ๏ no solo de comentarios vive el hombre David Calavera Conferencia Rails 2007
  • 5. 11870.com • recuerda y comparte negocios ... • no solo de comentarios vive el hombre ๏ ¿por qué tengo que atarme a la web? David Calavera Conferencia Rails 2007
  • 6. 11870.com • recuerda y comparte negocios ... • no solo de comentarios vive el hombre • ¿por qué tengo que atarme a la web? ๏ ¿quien tiene que adaptarse? David Calavera Conferencia Rails 2007
  • 8. “the atom publishing protocol is an application-level protocol for publishing and editing web resources” David Calavera Conferencia Rails 2007
  • 9. ๏ ¿sabes qué es HTTP y como usarlo? David Calavera Conferencia Rails 2007
  • 10. • ¿sabes qué es HTTP y como usarlo? ๏ ¿sabes qué es XML y como usarlo? David Calavera Conferencia Rails 2007
  • 11. • ¿sabes qué es HTTP y como usarlo? • ¿sabes qué es XML y como usarlo? ๏ ¿sabes qué es un feed y como crearlo? David Calavera Conferencia Rails 2007
  • 13. estándar http://ietfreport.isoc.org/idref/rfc5023 David Calavera Conferencia Rails 2007
  • 14. basado en atom <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?> <feed xmlns=quot;http://www.w3.org/2005/Atomquot; xml:lang=quot;enquot;> <id>http://www.verbosemode.com/wp-app.php/posts</id> <updated>2007-11-04T11:38:28Z</updated> <title type=quot;textquot;>Verbose mode</title> <subtitle type=quot;textquot;>Verbose mode</subtitle> <entry> <id>http://www.verbosemode.com/?p=3</id> <title type=quot;textquot;>Spanish Rails Conf 07</title> <updated>2007-11-04T11:38:28Z</updated> <published>2007-11-04T11:38:28Z</published> ... David Calavera Conferencia Rails 2007
  • 15. arquitectura REST David Calavera Conferencia Rails 2007
  • 16. arquitectura REST ๏ protocolo sin estado David Calavera Conferencia Rails 2007
  • 17. arquitectura REST • protocolo sin estado ๏ operaciones bien definidas David Calavera Conferencia Rails 2007
  • 18. arquitectura REST • protocolo sin estado • operaciones bien definidas ๏ sintaxis universal (IRI) David Calavera Conferencia Rails 2007
  • 19. IRI www. .w3.mag.keio.ac.jp David Calavera Conferencia Rails 2007
  • 21. introspectivo David Calavera Conferencia Rails 2007
  • 22. introspectivo documento de servicio David Calavera Conferencia Rails 2007
  • 23. introspectivo documento de servicio colección colección David Calavera Conferencia Rails 2007
  • 24. introspectivo documento de servicio colección elementos colección elementos David Calavera Conferencia Rails 2007
  • 25. fácilmente extensible <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?> <feed xmlns=quot;http://www.w3.org/2005/Atomquot; xml:lang=quot;enquot; xmlns:openSearch=quot;http://a9.com/-/spec/opensearchrss/1.0/quot;> <id>http://www.verbosemode.com/wp-app.php/posts</id> <updated>2007-11-04T11:38:28Z</updated> <title type=quot;textquot;>Verbose mode</title> <subtitle type=quot;textquot;>Verbose mode</subtitle> <openSearch:totalResults>1</openSearch:totalResults> <openSearch:startIndex>1</openSearch:startIndex> <openSearch:itemsPerPage>25</openSearch:itemsPerPage> <entry> <id>http://www.verbosemode.com/?p=3</id> <title type=quot;textquot;>Spanish Rails Conf 07</title> <updated>2007-11-04T11:38:28Z</updated> <published>2007-11-04T11:38:28Z</published> ... David Calavera Conferencia Rails 2007
  • 26. multimedia David Calavera Conferencia Rails 2007
  • 27. más... ๏ paginación David Calavera Conferencia Rails 2007
  • 28. <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?> <feed xmlns=quot;http://www.w3.org/2005/Atomquot; xml:lang=quot;enquot;> <id>http://www.verbosemode.com/wp-app.php/posts</id> <updated>2007-11-04T11:38:28Z</updated> <link rel=quot;selfquot; href=quot;http://www.verbosemode.com/wp-app.php/posts?p=3quot;/> <link rel=quot;nextquot; href=quot;http://www.verbosemode.com/wp-app.php/posts?p=4quot;/> <link rel=quot;previousquot; href=quot;http://www.verbosemode.com/wp-app.php/posts?p=2quot;/> <link rel=quot;firstquot; href=quot;http://www.verbosemode.com/wp-app.php/postsquot;/> <link rel=quot;lastquot; href=quot;http://www.verbosemode.com/wp-app.php/posts?p=5quot;/> ... David Calavera Conferencia Rails 2007
  • 29. más... • paginación ๏ caché David Calavera Conferencia Rails 2007
  • 30. POST /wp-app.php/posts HTTP/1.1 201 Created Content-Type: application/atom+xml;type=entry;charset=quot;utf-8quot; ETag: quot;c180de84f991g8quot; David Calavera Conferencia Rails 2007
  • 31. POST /wp-app.php/posts HTTP/1.1 201 Created Content-Type: application/atom+xml;type=entry;charset=quot;utf-8quot; ETag: quot;c180de84f991g8quot; GET /wp-app.php/post/3 HTTP/1.1 304 Not Modified If-None-Match: quot;c180de84f991g8quot; David Calavera Conferencia Rails 2007
  • 32. POST /wp-app.php/posts HTTP/1.1 201 Created Content-Type: application/atom+xml;type=entry;charset=quot;utf-8quot; ETag: quot;c180de84f991g8quot; GET /wp-app.php/post/3 HTTP/1.1 304 Not Modified If-None-Match: quot;c180de84f991g8quot; PUT /wp-app.php/post/3 HTTP/1.1 412 Precondition Failed If-Match: quot;c180de84f991g8quot; David Calavera Conferencia Rails 2007
  • 33. más... • paginación • caché ๏ control de estado David Calavera Conferencia Rails 2007
  • 34. <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?> <entry xmlns=quot;http://www.w3.org/2005/Atomquot; xmlns:app=quot;http://www.w3.org/2007/appquot; xml:lang=quot;enquot;> <id>http://www.verbosemode.com/?p=3</id> <title type=quot;textquot;>Spanish Rails Conf 07</title> <app:control> <app:draft>no</app:draft> </app:control> ... David Calavera Conferencia Rails 2007
  • 35. más... • paginación • caché • control de estado ๏ seguridad David Calavera Conferencia Rails 2007
  • 37. atomPub:service GET 'http://www.verbosemode.com/wp-app.php/service' HTTP/1.1 200 OK David Calavera Conferencia Rails 2007
  • 38. atomPub:service <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?> <service xmlns=quot;http://www.w3.org/2007/appquot; xmlns:atom=quot;http://www.w3.org/2005/Atomquot;> <workspace> <atom:title>Workspace</atom:title> <collection href=quot;http://www.verbosemode.com/wp-app.php/postsquot;> <atom:title>Posts</atom:title> <accept>application/atom+xml;type=entry</accept> <categories href=quot;http://www.verbosemode.com/wp-app.php/categoriesquot;/> </collection> <collection href=quot;http://www.verbosemode.com/wp-app.php/attachmentsquot;> <atom:title>Media</atom:title> <accept>image/*</accept> <accept>audio/*</accept> <accept>video/*</accept> </collection> </workspace> </service> David Calavera Conferencia Rails 2007
  • 39. atomPub:service <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?> <service xmlns=quot;http://www.w3.org/2007/appquot; xmlns:atom=quot;http://www.w3.org/2005/Atomquot;> <workspace> <atom:title>Workspace</atom:title> <collection href=quot;http://www.verbosemode.com/wp-app.php/postsquot;> <atom:title>Posts</atom:title> <accept>application/atom+xml;type=entry</accept> <categories href=quot;http://www.verbosemode.com/wp-app.php/categoriesquot;/> </collection> <collection href=quot;http://www.verbosemode.com/wp-app.php/attachmentsquot;> <atom:title>Media</atom:title> <accept>image/*</accept> <accept>audio/*</accept> <accept>video/*</accept> </collection> </workspace> </service> David Calavera Conferencia Rails 2007
  • 40. atomPub:service <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?> <service xmlns=quot;http://www.w3.org/2007/appquot; xmlns:atom=quot;http://www.w3.org/2005/Atomquot;> <workspace> <atom:title>Workspace</atom:title> <collection href=quot;http://www.verbosemode.com/wp-app.php/postsquot;> <atom:title>Posts</atom:title> <accept>application/atom+xml;type=entry</accept> <categories href=quot;http://www.verbosemode.com/wp-app.php/categoriesquot;/> </collection> <collection href=quot;http://www.verbosemode.com/wp-app.php/attachmentsquot;> <atom:title>Media</atom:title> <accept>image/*</accept> <accept>audio/*</accept> <accept>video/*</accept> </collection> </workspace> </service> David Calavera Conferencia Rails 2007
  • 41. atomPub:service <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?> <service xmlns=quot;http://www.w3.org/2007/appquot; xmlns:atom=quot;http://www.w3.org/2005/Atomquot;> <workspace> <atom:title>Workspace</atom:title> <collection href=quot;http://www.verbosemode.com/wp-app.php/postsquot;> <atom:title>Posts</atom:title> <accept>application/atom+xml;type=entry</accept> <categories href=quot;http://www.verbosemode.com/wp-app.php/categoriesquot;/> </collection> <collection href=quot;http://www.verbosemode.com/wp-app.php/attachmentsquot;> <atom:title>Media</atom:title> <accept>image/*</accept> <accept>audio/*</accept> <accept>video/*</accept> </collection> </workspace> </service> David Calavera Conferencia Rails 2007
  • 42. atomPub:service <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?> <service xmlns=quot;http://www.w3.org/2007/appquot; xmlns:atom=quot;http://www.w3.org/2005/Atomquot;> <workspace> <atom:title>Workspace</atom:title> <collection href=quot;http://www.verbosemode.com/wp-app.php/postsquot;> <atom:title>Posts</atom:title> <accept>application/atom+xml;type=entry</accept> <categories href=quot;http://www.verbosemode.com/wp-app.php/categoriesquot;/> </collection> <collection href=quot;http://www.verbosemode.com/wp-app.php/attachmentsquot;> <atom:title>Media</atom:title> <accept>image/*</accept> <accept>audio/*</accept> <accept>video/*</accept> </collection> </workspace> </service> David Calavera Conferencia Rails 2007
  • 43. atomPub:categories GET 'http://www.verbosemode.com/wp-app.php/categories' HTTP/1.1 200 OK David Calavera Conferencia Rails 2007
  • 44. atomPub:categories <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?> <app:categories xmlns:app=quot;http://www.w3.org/2007/appquot; xmlns=quot;http://www.w3.org/2005/Atomquot; fixed=quot;yesquot; scheme=quot;http://www.verbosemode.comquot;> <category term=quot;atomPubquot; /> <category term=quot;railsquot; /> </app:categories> David Calavera Conferencia Rails 2007
  • 45. atomPub:collection POST 'http://www.verbosemode.com/wp-app.php/posts' HTTP/1.1 201 Created Content-Type: */* Location: 'http://www.verbosemode.com/wp-app.php/post/3' Content-Location: 'http://www.verbosemode.com/wp-app.php/post/3' GET 'http://www.verbosemode.com/wp-app.php/posts' HTTP/1.1 200 OK David Calavera Conferencia Rails 2007
  • 46. atomPub:collection <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?> <feed xmlns=quot;http://www.w3.org/2005/Atomquot; xmlns:app=quot;http://www.w3.org/2007/appquot; xml:lang=quot;enquot;> <id>http://www.verbosemode.com/wp-app.php/posts</id> <updated>2007-11-04T11:38:28Z</updated> <title type=quot;textquot;>Verbose mode</title> <link rel=quot;firstquot; href=quot;http://www.verbosemode.com/wp-app.php/postsquot;/> <link rel=quot;lastquot; href=quot;http://www.verbosemode.com/wp-app.php/postsquot;/> <link rel=quot;selfquot; href=quot;http://www.verbosemode.com/wp-app.php/postsquot;/> <entry> <id>http://www.verbosemode.com/?p=3</id> <title type=quot;textquot;>Spanish Rails Conf 07</title> <app:edited>2007-11-04T11:38:28Z</app:edited> <link rel=quot;editquot; href=quot;http://www.verbosemode.com/wp-app.php/post/3quot;/> <app:control><app:draft>no</app:draft></app:control> ... David Calavera Conferencia Rails 2007
  • 47. atomPub:collection <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?> <feed xmlns=quot;http://www.w3.org/2005/Atomquot; xmlns:app=quot;http://www.w3.org/2007/appquot; xml:lang=quot;enquot;> <id>http://www.verbosemode.com/wp-app.php/posts</id> <updated>2007-11-04T11:38:28Z</updated> <title type=quot;textquot;>Verbose mode</title> <link rel=quot;firstquot; href=quot;http://www.verbosemode.com/wp-app.php/postsquot;/> <link rel=quot;lastquot; href=quot;http://www.verbosemode.com/wp-app.php/postsquot;/> <link rel=quot;selfquot; href=quot;http://www.verbosemode.com/wp-app.php/postsquot;/> <entry> <id>http://www.verbosemode.com/?p=3</id> <title type=quot;textquot;>Spanish Rails Conf 07</title> <app:edited>2007-11-04T11:38:28Z</app:edited> <link rel=quot;editquot; href=quot;http://www.verbosemode.com/wp-app.php/post/3quot;/> <app:control><app:draft>no</app:draft></app:control> ... David Calavera Conferencia Rails 2007
  • 48. atomPub:collection <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?> <feed xmlns=quot;http://www.w3.org/2005/Atomquot; xmlns:app=quot;http://www.w3.org/2007/appquot; xml:lang=quot;enquot;> <id>http://www.verbosemode.com/wp-app.php/posts</id> <updated>2007-11-04T11:38:28Z</updated> <title type=quot;textquot;>Verbose mode</title> <link rel=quot;firstquot; href=quot;http://www.verbosemode.com/wp-app.php/postsquot;/> <link rel=quot;lastquot; href=quot;http://www.verbosemode.com/wp-app.php/postsquot;/> <link rel=quot;selfquot; href=quot;http://www.verbosemode.com/wp-app.php/postsquot;/> <entry> <id>http://www.verbosemode.com/?p=3</id> <title type=quot;textquot;>Spanish Rails Conf 07</title> <app:edited>2007-11-04T11:38:28Z</app:edited> <link rel=quot;editquot; href=quot;http://www.verbosemode.com/wp-app.php/post/3quot;/> <app:control><app:draft>no</app:draft></app:control> ... David Calavera Conferencia Rails 2007
  • 49. atomPub:entry PUT 'http://www.verbosemode.com/wp-app.php/post/3' HTTP/1.1 204 No Content Content-Type: application/atom+xml;type=entry DELETE 'http://www.verbosemode.com/wp-app.php/post/3' HTTP/1.1 200 OK GET 'http://www.verbosemode.com/wp-app.php/post/3' HTTP/1.1 200 OK David Calavera Conferencia Rails 2007
  • 50. atomPub:entry <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?> <entry xmlns=quot;http://www.w3.org/2005/Atomquot; xmlns:app=quot;http://www.w3.org/2007/appquot; xml:lang=quot;enquot;> <id>http://www.verbosemode.com/?p=3</id> <title type=quot;textquot;>Spanish Rails Conf 07</title> <updated>2007-11-04T15:43:49Z</updated> <published>2007-11-04T11:38:28Z</published> <app:edited>2007-11-04T15:43:49Z</app:edited> <app:control><app:draft>no</app:draft></app:control> <author><name>david</name></author> <content type=quot;xhtmlquot;><div xmlns='http://www.w3.org/1999/xhtml'> Next November 22 and 23 I'm going to attend to ...</div></content> <link rel=quot;editquot; href=quot;http://www.verbosemode.com/wp-app.php/post/3quot; /> <category scheme=quot;http://www.verbosemode.comquot; term=quot;atomPubquot; /> <category scheme=quot;http://www.verbosemode.comquot; term=quot;railsquot; /> <summary type=quot;textquot;>Next November 22 and 23 I&#8217;m ...</summary> </entry> David Calavera Conferencia Rails 2007
  • 51. atomPub:entry ¿y... qué pasa con los otros tipos de recursos? <entry xmlns=quot;http://www.w3.org/2005/Atomquot; xmlns:app=quot;http://www.w3.org/2007/appquot; xml:lang=quot;enquot;> <id>http://www.verbosemode.com/wp-content/uploads/2007/11/avatar.png</id> <title type=quot;textquot;>avatar poster</title> <updated>2007-11-13T21:59:55Z</updated> <published>2007-11-13T21:59:55Z</published> <app:edited>2007-11-13T21:59:55Z</app:edited> <app:control><app:draft>no</app:draft></app:control> <author><name>david</name></author> <link rel=quot;edit-mediaquot; href=quot;http://www.verbosemode.com/wp-app.php/attachment/file/4quot; /> <link rel=quot;editquot; href=quot;http://www.verbosemode.com/wp-app.php/post/4quot; /> <content type=quot;image/pngquot; src=quot;http://www.verbosemode.com/wp-content/uploads/2007/11/avatar.pngquot;/> </entry> David Calavera Conferencia Rails 2007
  • 52. atomPub:entry ¿y... qué pasa con los otros tipos de recursos? PUT 'http://www.verbosemode.com/wp-app.php/attachment/file/4' HTTP/1.1 204 No Content Content-Type: */* DELETE 'http://www.verbosemode.com/wp-app.php/attachment/file/4' HTTP/1.1 200 OK GET 'http://www.verbosemode.com/wp-app.php/attachment/file/4' HTTP/1.1 200 OK David Calavera Conferencia Rails 2007
  • 53.
  • 55. ๏ google: gdata, youtube, openSocial David Calavera Conferencia Rails 2007
  • 56. • google: gdata, youtube, openSocial ๏ microsoft: windows live writer David Calavera Conferencia Rails 2007
  • 57. • google: gdata, youtube, openSocial • microsoft: windows live writer ๏ ibm: lotus connections David Calavera Conferencia Rails 2007
  • 58. • google: gdata, youtube, openSocial • microsoft: windows live writer • ibm: lotus connections ๏ wordpress David Calavera Conferencia Rails 2007
  • 59. • google: gdata, youtube, openSocial • microsoft: windows live writer • ibm: lotus connections • wordpress ๏ nokia: liveblog David Calavera Conferencia Rails 2007
  • 60. • google: gdata, youtube, openSocial • microsoft: windows live writer • ibm: lotus connections • wordpress • nokia: liveblog ๏ six apart: typepad, movable type David Calavera Conferencia Rails 2007
  • 61. • google: gdata, youtube, openSocial • microsoft: windows live writer • ibm: lotus connections • wordpress • nokia: liveblog • six apart: typepad, movable type ๏ 11870.com
  • 63. Net::HTTP David Calavera Conferencia Rails 2007
  • 64. Net::HTTP ๏ fácil de mantener David Calavera Conferencia Rails 2007
  • 65. Net::HTTP • fácil de mantener ๏ respuesta condicionada al estado David Calavera Conferencia Rails 2007
  • 66. HTTPResponse HTTPSuccess # 2xx HTTPOK # 200 HTTPCreated # 201 HTTPRedirection # 3xx HTTPNotModified # 304 HTTPClientError # 4xx HTTPBadRequest # 400 HTTPUnauthorized # 401 HTTPForbidden # 403 HTTPNotFound # 404 HTTPPreconditionFailed # 412 HTTPUnsupportedMediaType # 415 HTTPServerError # 5xx HTTPInternalServerError # 500 David Calavera Conferencia Rails 2007
  • 67. Net:HTTP • fácil de mantener • respuesta condicionada al estado ๏ no sabe si estoy en una capa segura David Calavera Conferencia Rails 2007
  • 68. require 'net/http' require 'net/https' @uri = 'https://registro.conferenciarails.org' http = Net::HTTP.new @uri http.use_ssl = true if @uri =~ /^https/ David Calavera Conferencia Rails 2007
  • 69. los cuatro verbos http Net::HTTP.start(@uri.host, @uri.port) do |http| end David Calavera Conferencia Rails 2007
  • 70. los cuatro verbos http Net::HTTP.start(@uri.host, @uri.port) do |http| #POST http.request Net::HTTP::Post.new(@uri.path), data end David Calavera Conferencia Rails 2007
  • 71. los cuatro verbos http Net::HTTP.start(@uri.host, @uri.port) do |http| #POST http.request Net::HTTP::Post.new(@uri.path), data #GET http.request Net::HTTP::Get.new(@uri.path) end David Calavera Conferencia Rails 2007
  • 72. los cuatro verbos http Net::HTTP.start(@uri.host, @uri.port) do |http| #POST http.request Net::HTTP::Post.new(@uri.path), data #GET http.request Net::HTTP::Get.new(@uri.path) #PUT http.request Net::HTTP::Put.new(@uri.path), data end David Calavera Conferencia Rails 2007
  • 73. los cuatro verbos http Net::HTTP.start(@uri.host, @uri.port) do |http| #POST http.request Net::HTTP::Post.new(@uri.path), data #GET http.request Net::HTTP::Get.new(@uri.path) #PUT http.request Net::HTTP::Put.new(@uri.path), data #DELETE http.request Net::HTTP::Delete.new(@uri.path) end David Calavera Conferencia Rails 2007
  • 74. REXML ๏ parser completo David Calavera Conferencia Rails 2007
  • 75. REXML • parser completo ๏ escrito completamente en ruby David Calavera Conferencia Rails 2007
  • 76. REXML • parser completo • escrito completamente en ruby ๏ pasa los test de aceptación de Oasis David Calavera Conferencia Rails 2007
  • 77. REXML • parser completo • escrito completamente en ruby • pasa los test de aceptación de Oasis ๏ soporta XPath David Calavera Conferencia Rails 2007
  • 78. REXML y xpath NS = {'atom' => 'http://www.w3.org/2005/Atom', 'app' => 'http://www.w3.org/2007/app', 'georss' => 'http://www.georss.org/georss/10', 'gml' => 'http://www.opengis.net/gml' } REXML::XPath.each( feed.root, './atom:entry', NS) do |entry| title = REXML::XPath.first(entry, './atom:title/text()', NS) edited = REXML::XPath.first(entry, './app:edited/text()', NS) pos = REXML::XPath.first(entry, './georss:where/gml:Point/gml:pos/text()', NS) end David Calavera Conferencia Rails 2007
  • 79. REXML y xpath NS = {'atom' => 'http://www.w3.org/2005/Atom', 'app' => 'http://www.w3.org/2007/app', 'georss' => 'http://www.georss.org/georss/10', 'gml' => 'http://www.opengis.net/gml' } REXML::XPath.each( feed.root, './atom:entry', NS) do |entry| title = REXML::XPath.first(entry, './atom:title/text()', NS) edited = REXML::XPath.first(entry, './app:edited/text()', NS) pos = REXML::XPath.first(entry, './georss:where/gml:Point/gml:pos/text()', NS) end David Calavera Conferencia Rails 2007
  • 80. REXML y xpath NS = {'atom' => 'http://www.w3.org/2005/Atom', 'app' => 'http://www.w3.org/2007/app', 'georss' => 'http://www.georss.org/georss/10', 'gml' => 'http://www.opengis.net/gml' } REXML::XPath.each( feed.root, './atom:entry', NS) do |entry| title = REXML::XPath.first(entry, './atom:title/text()', NS) edited = REXML::XPath.first(entry, './app:edited/text()', NS) pos = REXML::XPath.first(entry, './georss:where/gml:Point/gml:pos/text()', NS) end David Calavera Conferencia Rails 2007
  • 81. REXML y xpath NS = {'atom' => 'http://www.w3.org/2005/Atom', 'app' => 'http://www.w3.org/2007/app', 'georss' => 'http://www.georss.org/georss/10', 'gml' => 'http://www.opengis.net/gml' } REXML::XPath.each( feed.root, './atom:entry', NS) do |entry| title = REXML::XPath.first(entry, './atom:title/text()', NS) edited = REXML::XPath.first(entry, './app:edited/text()', NS) pos = REXML::XPath.first(entry, './georss:where/gml:Point/gml:pos/text()', NS) end David Calavera Conferencia Rails 2007
  • 82. REXML y xpath NS = {'atom' => 'http://www.w3.org/2005/Atom', 'app' => 'http://www.w3.org/2007/app', 'georss' => 'http://www.georss.org/georss/10', 'gml' => 'http://www.opengis.net/gml' } REXML::XPath.each( feed.root, './atom:entry', NS) do |entry| title = REXML::XPath.first(entry, './atom:title/text()', NS) edited = REXML::XPath.first(entry, './app:edited/text()', NS) pos = REXML::XPath.first(entry, './georss:where/gml:Point/gml:pos/text()', NS) end David Calavera Conferencia Rails 2007
  • 83. Builder ๏ crea xml fácilmente David Calavera Conferencia Rails 2007
  • 84. require 'builder' builder = Builder::XmlMarkup.new xml = builder.feed( 'xmlns' => 'http://www.w3.org/2005/Atom' ) do |feed| feed.id 'http://conferenciarails.org/atomPub' feed.updated Time.now feed.author do |author| author.name 'David Calavera' end feed.entry do |entry| entry.title 'entrada para la conferencia rails' end end David Calavera Conferencia Rails 2007
  • 85. Builder • crea xml fácilmente ๏ no solo se usa con rails David Calavera Conferencia Rails 2007
  • 86. ๏ in the beginning... was the command line builder = Builder::XmlMarkup.new(:target=>STDOUT, :indent=>2) David Calavera Conferencia Rails 2007
  • 87. • in the beginning... was the command line builder = Builder::XmlMarkup.new(:target=>STDOUT, :indent=>2) ๏ vamos de camping Camping.goes :Atom module Atom::Views def index html do head do title 'Atom Publishing Protocol @ conferecia rails' end body do ... end end end David Calavera Conferencia Rails 2007
  • 89. atom-tools http://code.necronomicorp.com/atom-tools ๏ parsea y manipula feeds David Calavera Conferencia Rails 2007
  • 90. atom-tools http://code.necronomicorp.com/atom-tools • parsea y manipula feeds ๏ adaptado al rfc 5023 David Calavera Conferencia Rails 2007
  • 91. atom-tools http://code.necronomicorp.com/atom-tools • parsea y manipula feeds • adaptado al rfc 5023 ๏ abstracción de http y xml David Calavera Conferencia Rails 2007
  • 92. require 'atom-tools' http = Atom::HTTP.new http.user = 'david' http.pass = 'my password' http.always_auth :basic service = Atom::Service.new 'http://verbosemode.com/wp-app.php/service', http service.collections.each do |collection| puts collection.accepts end David Calavera Conferencia Rails 2007
  • 93. require 'atom-tools' http = Atom::HTTP.new http.user = 'david' http.pass = 'my password' http.always_auth :basic service = Atom::Service.new 'http://verbosemode.com/wp-app.php/service', http service.collections.each do |collection| puts collection.accepts end David Calavera Conferencia Rails 2007
  • 94. require 'atom-tools' http = Atom::HTTP.new http.user = 'david' http.pass = 'my password' http.always_auth :basic service = Atom::Service.new 'http://verbosemode.com/wp-app.php/service', http service.collections.each do |collection| puts collection.accepts end David Calavera Conferencia Rails 2007
  • 95. atom_pub_server http://svn.thinkincode.net/rails/plugins/atom_pub_server ๏ rails es REST David Calavera Conferencia Rails 2007
  • 96. atom_pub_server http://svn.thinkincode.net/rails/plugins/atom_pub_server • rails es REST ๏ mejor soporte para atom y atomPub David Calavera Conferencia Rails 2007
  • 97. atom_feed do |feed| feed.title(quot;My great blog!quot;) feed.updated((@posts.first.created_at)) for post in @posts feed.entry(post) do |entry| entry.tag!('georss:where', 'xmlns:georss' => 'http://www.georss.org/georss/10') do |where| where.tag!('gml:Poing', 'xmlns:gml' => 'http://www.opengis.net/gml') do |point| point.tag!('gml:pos', nil, '40.419967 -3.698965') end end David Calavera Conferencia Rails 2007
  • 98. atom_feed({'xmlns:georss' => 'http://www.georss.org/georss/10', 'xmlns:gml' => 'http://www.opengis.net/gml'}) do |feed| feed.title(quot;My great blog!quot;) feed.updated((@posts.first.created_at)) for post in @posts feed.entry(post) do |entry| entry.georss:where do |where| where.gml:Point do |point| point.tag!('gml:pos', '40.419967 -3.698965') end end David Calavera Conferencia Rails 2007
  • 99. atom_pub_server http://svn.thinkincode.net/rails/plugins/atom_pub_server • rails es REST • mejor soporte para atom y atomPub ๏ acts_as_collection David Calavera Conferencia Rails 2007
  • 100. class PostsController < ApplicationController acts_as_collection :title => 'Posts', :workspace => 'Blog', :accept => Mime::ATOM_ENTRY, :href => 'http::/verbosemode.com/atomPub/posts', :categories => [ { :fixed => 'yes', :scheme => 'http://verbosemode.com/tags', :category => [{:term => 'rails'}, {:term => 'plugins'}] }, {:href => 'http://verbosemode.com/mysections'} ] end David Calavera Conferencia Rails 2007
  • 101. atom_pub_server http://svn.thinkincode.net/rails/plugins/atom_pub_server • rails es REST • mejor soporte para atom y atomPub • acts_as_collection ๏ acts_as_service_document David Calavera Conferencia Rails 2007
  • 102. class ServicesController < ApplicationController acts_as_service_document def index render :xml => service_document end end David Calavera Conferencia Rails 2007
  • 103. the ape http://www.tbray.org/ape ๏ the atom publishing exerciser
  • 104. the ape http://www.tbray.org/ape • the atom publishing exerciser ๏ introspección!!! David Calavera Conferencia Rails 2007
  • 105. David Calavera Conferencia Rails 2007
  • 106. the ape http://www.tbray.org/ape • the atom publishing exerciser • introspección!!! ๏ varios sistemas de autenticación David Calavera Conferencia Rails 2007
  • 107. David Calavera Conferencia Rails 2007
  • 108. the ape http://www.tbray.org/ape • the atom publishing exerciser • introspección!!! • varios sistemas de autenticación ๏ no es muy fácil de instalar (de momento) David Calavera Conferencia Rails 2007
  • 109. the ape http://www.tbray.org/ape • the atom publishing exerciser • introspección!!! • varios sistemas de autenticación • no es muy fácil de instalar (de momento) ๏ no es muy fácil de configurar (de momento) David Calavera Conferencia Rails 2007
  • 110. la api de 11870.com http://11870.com/api
  • 111. por partes ๏ api de búsqueda ➡ formato openSearch (http://opensearch.org) David Calavera Conferencia Rails 2007
  • 112. <?xml version=quot; 1.0quot; encoding=quot;UTF-8quot;?> <service xmlns:atom=quot;http://www.w3.org/2005/Atomquot; xmlns=quot;http://www.w3.org/2007/app quot; xml:base=quot;http://11870.com/quot;> <workspace> <atom:title type=quot;textquot;>11870 workspace</atom:title> <collection href=quot;/api/v1/searchquot;> <atom:title type=quot;textquot;>Search</atom:title> </collection> </workspace> </service> David Calavera Conferencia Rails 2007
  • 113. por partes • api de búsqueda ๏ api de gestión de contenidos David Calavera Conferencia Rails 2007
  • 114. <?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?> <service xmlns:atom=quot;http://www.w3.org/2005/Atomquot; xmlns=quot; http://www.w3.org/2007/appquot; xml:base=quot;http://localhost/quot;> <workspace> <atom:title type=quot;textquot;>11870 workspace</atom:title> <collection href=quot;/api/v1/sites/calaveraquot;> <atom:title type=quot;textquot;>Sites</atom:title> <accept>application/atom+xml;type=entry</accept> <categories xmlns:oos=quot;http://11870.com/api/oos quot; href=quot;http://localhost/api/v1/lists/calaveraquot; oos:label=quot;listsquot;/> <categories xmlns:oos=quot; http://11870.com/api/oosquot; href=quot;http://localhost/api/v1/tags/calaveraquot; oos:label=quot;tagsquot;/> <categories xmlns:oos=quot; http://11870.com/api/oosquot; href=quot;http://localhost/api/v1/privacyquot; oos:label=quot;privacyquot;/> </collection> <collection href=quot;/api/v1/contacts/calaveraquot;> <atom:title type=quot;textquot;>Contacts</atom:title> <accept>application/atom+xml;type=entry</accept> <categories xmlns:oos=quot; http://11870.com/api/oosquot; href=quot;http://localhost/api/v1/trustedquot; oos:label=quot;trustedquot;/> </collection> <collection href=quot;/api/v1/usersquot;> <atom:title type=quot;textquot;>Users</atom:title> <accept>image/*</accept> <accept>application/atom+xml;type=entry</accept> </collection> <collection href=quot;/api/v1/searchquot;> <atom:title type=quot;textquot;>Search</atom:title> </collection> </workspace> </service> David Calavera Conferencia Rails 2007
  • 115. más allá de atomPub ๏ sintaxis David Calavera Conferencia Rails 2007
  • 116. <entry xmlns:app=quot;http://www.w3.org/2007/appquot; xmlns:oos=quot;http://11870.com/api/oosquot; xmlns:georss=quot;http://www.georss.org/georss/10quot; xmlns=quot;http://www.w3.org/2005/Atomquot; xml:lang=quot;enquot;> <id>http://11870.com/pro/23474/calavera</id> <title type=quot;textquot;>Apple Store Fifth Avenue</title> <oos:useraddress>767 5th Avenue</oos:useraddress> <oos:url>http://www.apple.com/retail/fifthavenue</oos:url> <oos:telephone>+1 212 3361440</oos:telephone> <oos:locality slug=quot;/us/new-yorkquot;>New York</oos:locality> <oos:country slug=quot;/usquot;>United States</oos:country> David Calavera Conferencia Rails 2007
  • 117. más allá de atomPub • sintaxis ๏ autenticación David Calavera Conferencia Rails 2007
  • 118. más allá de atomPub • sintaxis ๏ autenticación ➡ identificar aplicaciones David Calavera Conferencia Rails 2007
  • 119. Net::HTTP.start( '11870.com' ) do |http| req = Net::HTTP::Get.new('/api/v1') req['appToken'] = 'el app token que 11870 te ha asignado' digest = Digest::MD5.hexdigest(quot;#{req['appToken']}#{la clave secreta}quot;) req['authSign'] = digest http.request req end David Calavera Conferencia Rails 2007
  • 120. más allá de atomPub • sintaxis ๏ autenticación ➡ identificar aplicaciones ➡ autenticar usuarios David Calavera Conferencia Rails 2007
  • 121. request['Authorization'] = 'WSSE profile=quot;UsernameTokenquot;' request['X-WSSE'] = wsse! def wsse! nonce = Array.new(10){ rand(0x1000000) }.pack('I*') nonce_b64 = [nonce].pack(quot;mquot;).chomp now = Time.now.gmtime.strftime(quot;%FT%TZquot;) digest = [Digest::SHA1.digest(nonce_b64 + now + @password)].pack(quot;mquot;).chomp %Q<UsernameToken Username=quot;#{@username}quot;, PasswordDigest=quot;#{digest}quot;, Nonce=quot;#{nonce_b64}quot;, Created=quot;#{now}quot;> end David Calavera Conferencia Rails 2007
  • 122. más allá de atomPub • sintaxis ๏ autenticación ➡ identificar aplicaciones ➡ autenticar usuarios ➡ evolucionará a OAuth (http://oauth.net) David Calavera Conferencia Rails 2007
  • 123. más allá de atomPub • sintaxis • autenticación ๏ múltiples representaciones David Calavera Conferencia Rails 2007
  • 124. { quot;idquot;:quot;/api/v1/sites/calaveraquot;, quot;titlequot;:quot;Sitesquot;, quot;updatedquot;:quot;2007-09-28T07:53:46.000Zquot;, quot;authorsquot;:[{ quot;namequot;:quot;calaveraquot; } ], quot;linksquot;:[{ quot;hrefquot;:quot;http://11870.com/api/v1/sites/calaveraquot;, quot;relquot;:quot;selfquot; },{ quot;hrefquot;:quot;http://11870.com/api/v1/sites/calavera?page=2quot;, quot;relquot;:quot;nextquot; } ], quot;entriesquot;:[{ quot;langquot;:quot;esquot;, quot;idquot;:quot;http://11870.com/pro/23474/calaveraquot;, quot;titlequot;:quot;Apple Store Fifth Avenuequot;, quot;summaryquot;:quot;en directoquot;, quot;contentquot;:quot;estoy ahora mismo en esta... David Calavera Conferencia Rails 2007
  • 125. más allá de atomPub • sintaxis • autenticación • múltiples representaciones ๏ control de versiones David Calavera Conferencia Rails 2007
  • 126. ๏ ahora Net::HTTP.start( '11870.com' ) do |http| http.request Net::HTTP::Get.new('/api/v1') end David Calavera Conferencia Rails 2007
  • 127. • ahora Net::HTTP.start( '11870.com' ) do |http| http.request Net::HTTP::Get.new('/api/v1') end ๏ en un futuro Net::HTTP.start( '11870.com' ) do |http| http.request Net::HTTP::Get.new('/api/v1.5') end David Calavera Conferencia Rails 2007
  • 128. más allá de atomPub • sintaxis • autenticación • múltiples representaciones • control de versiones ๏ soporte de librerías David Calavera Conferencia Rails 2007
  • 130. más allá de atomPub • sintaxis • autenticación • múltiples representaciones • control de versiones • soporte de librerías ๏ ¡documentación! David Calavera Conferencia Rails 2007
  • 132. la api de 11870.com oos4ruby
  • 133. búsqueda require 'oos4ruby' oos = Oos.new oos.auth_app 'appToken', 'secretKey' oos.search q => 'apple store in new york' oos.search bbox => ['SOUTH', 'WEST', 'NORTH', 'EAST'] oos.search lat => 'LATITUDE', lon => 'LONGITUDE', radius => '3000 METRES' oos.search tags => ['restaurant', 'cheap', 'clean'] David Calavera Conferencia Rails 2007
  • 134. búsqueda require 'oos4ruby' oos = Oos.new oos.auth_app 'appToken', 'secretKey' oos.search q => 'apple store in new york' oos.search bbox => ['SOUTH', 'WEST', 'NORTH', 'EAST'] oos.search lat => 'LATITUDE', lon => 'LONGITUDE', radius => '3000 METRES' oos.search tags => ['restaurant', 'cheap', 'clean'] David Calavera Conferencia Rails 2007
  • 135. búsqueda require 'oos4ruby' oos = Oos.new oos.auth_app 'appToken', 'secretKey' oos.search q => 'apple store in new york' oos.search bbox => ['SOUTH', 'WEST', 'NORTH', 'EAST'] oos.search lat => 'LATITUDE', lon => 'LONGITUDE', radius => '3000 METRES' oos.search tags => ['restaurant', 'cheap', 'clean'] David Calavera Conferencia Rails 2007
  • 136. búsqueda require 'oos4ruby' oos = Oos.new oos.auth_app 'appToken', 'secretKey' oos.search q => 'apple store in new york' oos.search bbox => ['SOUTH', 'WEST', 'NORTH', 'EAST'] oos.search lat => 'LATITUDE', lon => 'LONGITUDE', radius => '3000 METRES' oos.search tags => ['restaurant', 'cheap', 'clean'] David Calavera Conferencia Rails 2007
  • 137. búsqueda require 'oos4ruby' oos = Oos.new oos.auth_app 'appToken', 'secretKey' oos.search q => 'apple store in new york' oos.search bbox => ['SOUTH', 'WEST', 'NORTH', 'EAST'] oos.search lat => 'LATITUDE', lon => 'LONGITUDE', radius => '3000 METRES' oos.search tags => ['restaurant', 'cheap', 'clean'] David Calavera Conferencia Rails 2007
  • 138. gestión require 'oos4ruby' oos = Oos.new oos.auth_user 'user email', 'auth token' user = oos.user user.sites.each do |pro| unless pro.multimedia.empty? pro.multimedia.each do |media| puts media.type puts media.src end end end user.contacts.create! :slug => 'calavera', :trusted => 'true' user.update_avatar! '/Users/david/skull.png' David Calavera Conferencia Rails 2007
  • 139. gestión require 'oos4ruby' oos = Oos.new oos.auth_user 'user email', 'auth token' user = oos.user user.sites.each do |pro| unless pro.multimedia.empty? pro.multimedia.each do |media| puts media.type puts media.src end end end user.contacts.create! :slug => 'calavera', :trusted => 'true' user.update_avatar! '/Users/david/skull.png' David Calavera Conferencia Rails 2007
  • 140. gestión require 'oos4ruby' oos = Oos.new oos.auth_user 'user email', 'auth token' user = oos.user user.sites.each do |pro| unless pro.multimedia.empty? pro.multimedia.each do |media| puts media.type puts media.src end end end user.contacts.create! :slug => 'calavera', :trusted => 'true' user.update_avatar! '/Users/david/skull.png' David Calavera Conferencia Rails 2007
  • 141. gestión require 'oos4ruby' oos = Oos.new oos.auth_user 'user email', 'auth token' user = oos.user user.sites.each do |pro| unless pro.multimedia.empty? pro.multimedia.each do |media| puts media.type puts media.src end end end user.contacts.create! :slug => 'calavera', :trusted => 'true' user.update_avatar! '/Users/david/skull.png' David Calavera Conferencia Rails 2007
  • 142. ¿...?