nicolas pastorino - rest + recommendation, consume the right content, anywhere - ipc11
DESCRIPTION
This talk was given at IPC, Mainz, Oct. 10th. 2011. Please rate at : http://joind.in/3852TRANSCRIPT
REST + Recommendation: consume the right content, anywhere
REST + Recommendation: consume the right content, anywhere
Nicolas Pastorino - [email protected] Community - eZ Systems@jeanvoye - http://share.ez.no
REST + Recommendation: consume the right content, anywhere
Nicolas Pastorino - [email protected] Community - eZ Systems@jeanvoye - http://share.ez.no
International PHP Conference 2011 - Mainz - October 10th
#ipc11
Our agenda :
Multichannel emotionOur agenda :
Multichannel emotionREST
Our agenda :
Multichannel emotionREST
Extensible REST API
Our agenda :
Multichannel emotionREST
Extensible REST API
Our agenda :
Content recommendation
Multichannel : emotion
3
Online content touches you,
Online content touches you, it spurs emotions anywhere, on any device
Online content touches you, it spurs emotions anywhere, on any device
Online content touches you, it spurs emotions anywhere, on any device
Online content touches you, it spurs emotions anywhere, on any device
You are consuming content, all the time
You are consuming content, all the time
You are consuming content, all the time
You are consuming content, all the time
Multichannel content distribution is “emotions anywhere”
30/05/2011Nicolas Pastorino - IPCse11
Pre-requisites to multichannel distribution
8
30/05/2011Nicolas Pastorino - IPCse11
Pre-requisites to multichannel distribution
8
Separation of layout and content at the content source level
1
30/05/2011Nicolas Pastorino - IPCse11
Pre-requisites to multichannel distribution
8
Separation of layout and content at the content source level
1
30/05/2011Nicolas Pastorino - IPCse11
Pre-requisites to multichannel distribution
8
Separation of layout and content at the content source level
1
Do not compromise on user experience 2
30/05/2011Nicolas Pastorino - IPCse11
Pre-requisites to multichannel distribution
8
“The Superman Effect” Aral Balkan, DPC11
Separation of layout and content at the content source level
1
Do not compromise on user experience 2
30/05/2011Nicolas Pastorino - IPCse11
Pre-requisites to multichannel distribution
8
“The Superman Effect” Aral Balkan, DPC11
“There is a lot of effort going into improving customer experience. It is key to get consistency across different channels so their experience does not vary” Jim Daviesni
Separation of layout and content at the content source level
1
Do not compromise on user experience 2
30/05/2011Nicolas Pastorino - IPCse11
Pre-requisites to multichannel distribution
8
“The Superman Effect” Aral Balkan, DPC11
“There is a lot of effort going into improving customer experience. It is key to get consistency across different channels so their experience does not vary” Jim Daviesni
Separation of layout and content at the content source level
1
Do not compromise on user experience 2
Have a single source of content 3
30/05/2011Nicolas Pastorino - IPCse11
Pre-requisites to multichannel distribution
8
“The Superman Effect” Aral Balkan, DPC11
“There is a lot of effort going into improving customer experience. It is key to get consistency across different channels so their experience does not vary” Jim Daviesni
Separation of layout and content at the content source level
1
Do not compromise on user experience 2
Have a single source of content 3
“Publishers usually can't afford a dedicated editorial team per channel”
Are 3 rules of thumb
enough ?
Are 3 rules of thumb
enough ? We’re
hardly off the ground.
Let’s dig further...
CMSSingle Content Source /
CMSSingle Content Source /
CMSSingle Content Source /
Monetized Content Streams
CMSSingle Content Source /
Monetized Content Streams
Mobile ApplicationsSmartphones, Tablets
CMSSingle Content Source /
Monetized Content Streams
Mobile ApplicationsSmartphones, Tablets
Push ContentNewsletters
3rd partyCRM, ERP
CMSSingle Content Source /
Monetized Content Streams
Mobile ApplicationsSmartphones, Tablets
Push ContentNewsletters
PrintLegacy publication chains
3rd partyCRM, ERP
CMSSingle Content Source /
Monetized Content Streams
Mobile ApplicationsSmartphones, Tablets
Push ContentNewsletters
PrintLegacy publication chains
Social Media
3rd partyCRM, ERP
"Multichannel media consumers have higher levels of engagement than those present in only one channel.
The more one watches TV, listens to the radio, spends time online, etc., the more advertising they consume.
This shows that multichannel content distribution will also have an important impact on the publishers revenue structure. It will evolve to become a competitive, critical, enabling technology for marketing communications."
Having a REST ?
:)
Having a REST ?
:)
We are not there yet, let’s
dig further
“Media companies as well as consumer brands must recognize that adding mobile to the multichannel mix does not mean creating a mini-channel. Those building mobile strategies should recognize that:
• Mobile is not just about shrinking the desktop experience,
• The user environment is an element of the (mobile) experience,
• Mobile users are not simply a subset of online users – some are new.”
Least Common
Denominator :
Least Common
Denominator :
a REST API
Those were the
functional basics to increase
your REACHthrough multiple
channels
Those were the
functional basics to increase
your REACHthrough multiple
channels
Now come the technical bits
REST
16
REpresentational State Transfer
REpresentational State Transfer
REST is a set of principles that define how Web standards, such as HTTP and URIs, are supposed to be used.
• Give every “thing” an ID• Link things together (“HATEOAS”) (cf David Zuelke’s keynote)• Use standard methods• Resources with multiple representations• Communicate statelessly
REpresentational State Transfer
REST is a set of principles that define how Web standards, such as HTTP and URIs, are supposed to be used.
• Give every “thing” an ID• Link things together (“HATEOAS”) (cf David Zuelke’s keynote)• Use standard methods• Resources with multiple representations• Communicate statelessly
h"p://en.wikipedia.org/wiki/Representa4onal_State_Transferh"p://www.infoq.com/ar4cles/rest-‐introduc4on
REpresentational State Transfer
h"p://en.wikipedia.org/wiki/Representa4onal_State_Transferh"p://www.infoq.com/ar4cles/rest-‐introduc4on
REpresentational State Transfer
Key goals of REST include:
• Scalability of component interactions• Generality of interfaces• Independent deployment of components• Intermediary components to reduce latency, enforce security and encapsulate legacy systems
h"p://en.wikipedia.org/wiki/Representa4onal_State_Transferh"p://www.infoq.com/ar4cles/rest-‐introduc4on
Extensible REST API
19
at the core of the eZ Publish CMS
30/05/2011Nicolas Pastorino - IPCse11
At the core of the eZ Publish CMS
REST as a core feature
20
Extensible REST API
30/05/2011Nicolas Pastorino - IPCse11
Dedicated front-controller
21
At the core of the eZ Publish CMS Extensible REST API
30/05/2011Nicolas Pastorino - IPCse11 22
REST setup
REST
FC
eZPREST request
eZ Publishweb-‐request
At the core of the eZ Publish CMS Extensible REST API
30/05/2011Nicolas Pastorino - IPCse11 22
REST setup
REST
FC
eZPREST request
eZ Publishweb-‐request
At the core of the eZ Publish CMS Extensible REST API
30/05/2011Nicolas Pastorino - IPCse11 23
Mapping content into resources
At the core of the eZ Publish CMS Extensible REST API
30/05/2011Nicolas Pastorino - IPCse11 24
Makes data availableMakes data available
At the core of the eZ Publish CMS Extensible REST API
30/05/2011Nicolas Pastorino - IPCse11 24
Makes data reusableMakes data reusable
At the core of the eZ Publish CMS Extensible REST API
30/05/2011Nicolas Pastorino - IPCse11 25
Content is essentially liberated
At the core of the eZ Publish CMS Extensible REST API
30/05/2011Nicolas Pastorino - IPCse11
URI pattern
26
At the core of the eZ Publish CMS Extensible REST API
30/05/2011Nicolas Pastorino - IPCse11 27
Prefix Provider VersionGET Host / / / / Call + params
Just a token to trigger your rewrite rule
ezpRestPrefixFilterInterface
At the core of the eZ Publish CMS Extensible REST API
30/05/2011Nicolas Pastorino - IPCse11 27
Prefix
Provider
Version
Just a token to trigger your rewrite rule
ezpRestPrefixFilterInterface
At the core of the eZ Publish CMS Extensible REST API
30/05/2011Nicolas Pastorino - IPCse11 27
Prefix
Provider
Version
Just a token to trigger your rewrite rule
ezpRestPrefixFilterInterface
At the core of the eZ Publish CMS Extensible REST API
30/05/2011Nicolas Pastorino - IPCse11 27
Prefix
Provider
Version
Just a token to trigger your rewrite rule
ezpRestPrefixFilterInterface
At the core of the eZ Publish CMS Extensible REST API
30/05/2011Nicolas Pastorino - IPCse11
Prefix filter
28
Current provider
Current parsed version value
ezpRestPrefixFilterInterface
30/05/2011Nicolas Pastorino - IPCse11
Versioned API
29
class ezpRestRouter extends ezcMvcRouter{ public function createRoutes() { // ezpRestApiProvider $routes = array( new ezcMvcRailsRoute( '/content/node/:nodeId/listAtom', 'ezpRestAtomController', 'collection' ), new ezcMvcRailsRoute( '/content/node/:nodeId/list', 'ezpRestContentController', 'list' ), new ezcMvcRailsRoute( '/content/node/:nodeId', 'ezpRestContentController', 'viewContent' ), new ezcMvcRailsRoute( '/content/node/:nodeId/fields', 'ezpRestContentController', 'viewFields' ), new ezcMvcRailsRoute( '/content/node/:nodeId/field/:fieldIdentifier', 'ezpRestContentController', 'viewField' ), new ezcMvcRailsRoute( '/content/object/:objectId', 'ezpRestContentController', 'viewContent' ), new ezcMvcRailsRoute( '/content/object/:objectId/fields', 'ezpRestContentController', 'viewFields' ), new ezcMvcRailsRoute( '/content/object/:objectId/field/:fieldIdentifier', 'ezpRestContentController', 'viewField' ),
new ezpRestVersionedRoute( new ezcMvcRailsRoute( '/foo', 'myController', 'myActionOne' ), 1 ), new ezpRestVersionedRoute( new ezcMvcRailsRoute( 'e/foo', 'myController2 or myControlerWhichExtendsmyController', 'myBetterAndScalingAction' ), 2 ), ); return ezcMvcRouter::prefix( '/api', $routes ); }}
30/05/2011Nicolas Pastorino - IPCse11
Versioned API
makes the notion version a part of the routing decision
30
Version
ezpRestVersionedRoute
30/05/2011Nicolas Pastorino - IPCse11
Build your own flavor,extend the interface(s)
31
At the core of the eZ Publish CMS Extensible REST API
30/05/2011Nicolas Pastorino - IPCse11
Extending the interface
32
REST providers
30/05/2011Nicolas Pastorino - IPCse11
Extending the interface
ezpRestProviderInterface
33
Overview of hooksthe places where you can go wild.
30/05/2011Nicolas Pastorino - IPCse11 35
30/05/2011Nicolas Pastorino - IPCse11
Route setup - Example
36
class ezpRestRouter extends ezcMvcRouter{ public function createRoutes() { $providerRoutes = ezpRestProvider::getProvider( ezpRestPrefixFilterInterface::getApiProviderName() )->getRoutes();
$routes = array( new ezpMvcRailsRoute( '/fatal', 'ezpRestErrorController', 'show' ), new ezpMvcRailsRoute( '/http-basic-auth', 'ezpRestAuthController', 'basicAuth' ), new ezpMvcRailsRoute( '/login/oauth', 'ezpRestAuthController', 'oauthRequired' ), new ezpMvcRailsRoute( '/oauth/token', 'ezpRestOauthTokenController', 'handleRequest'),
// ezpRestVersionedRoute( $route, $version ) // $version == 1 should be the same as if the only the $route had been present new ezpRestVersionedRoute( new ezpMvcRailsRoute( '/foo', 'myController', 'myActionOne' ), 1 ), new ezpRestVersionedRoute( new ezpMvcRailsRoute( '/foo', 'myController', 'myActionOneBetter' ), 2 ),
);
return ezcMvcRouter::prefix( '/api', array_merge( $providerRoutes, $routes ) ); }}
Extensible REST API
37
Key features
30/05/2011Nicolas Pastorino - IPCse11
Content resources
38
Key featuresExtensible REST API
30/05/2011Nicolas Pastorino - IPCse11
Key features
GET /[api]/v1/content/object/<objectId>/fields HTTP/1.1
39
30/05/2011Nicolas Pastorino - IPCse11
Key features
fields/<fieldname>
type (datatype string)
identifier (attribute identifier)
value (string representation of data)
id (object attribute numerical ID)
classattribute_id (class attribute numerical ID)
40
30/05/2011Nicolas Pastorino - IPCse11
Key features
GET /[api]/v1/content/object/<objectId>/field/
<FieldIdentifier> HTTP/1.1
41
Content Recommendation
42
YooChoose, eZ Recommender Engine
A tough selection needs to be made amongst the infinite amount of content published
A tough selection needs to be made amongst the infinite amount of content published
Which one is my slope ?
A tough selection needs to be made amongst the infinite amount of content published
A tough selection needs to be made amongst the infinite amount of content published
I only have 30 minutes a day, which posts should i read ?
A tough selection needs to be made amongst the infinite amount of content published
Doesn’t it feel like this sometimes :
One sometimes needs a helping hand to choose the right slope to ride, the right
content to consume
One sometimes needs a helping hand to choose the right slope to ride, the right
content to consume
One sometimes needs a helping hand to choose the right slope to ride, the right
content to consume
One sometimes needs a helping hand to choose the right slope to ride, the right
content to consume
Content recommendation
30/05/2011Nicolas Pastorino - IPCse11
Content recommendation
47
30/05/2011Nicolas Pastorino - IPCse11
Content recommendation
47
30/05/2011Nicolas Pastorino - IPCse11
Content recommendation
47
Track content consumption
30/05/2011Nicolas Pastorino - IPCse11
Content recommendation
47
Track content consumption
+
Learn content metadata
30/05/2011Nicolas Pastorino - IPCse11
Content recommendation
47
Track content consumption
+
Learn content metadata
=
Content Recommendation
Cloud-based learning of behaviors using • Events “Viewing, Purchasing, Rating, Sharing”
• Models Users who viewed A also viewed B
• Stereotypes Affinity calculated against larger sets of content
30/05/2011Nicolas Pastorino - IPCse11
Content recommendation
49
30/05/2011Nicolas Pastorino - IPCse11
Content recommendation
49
Hybrid filteringIncreasing recommendation quality by combining
methods for qualifying behaviors
30/05/2011Nicolas Pastorino - IPCse11
Content recommendation
49
Content-based filtering
~
“Content like this”
Hybrid filteringIncreasing recommendation quality by combining
methods for qualifying behaviors
30/05/2011Nicolas Pastorino - IPCse11
Content recommendation
49
Content-based filtering
~
“Content like this”
Collaborative filtering
“Customers who were interested in this product also bought …”
Hybrid filteringIncreasing recommendation quality by combining
methods for qualifying behaviors
30/05/2011Nicolas Pastorino - IPCse11
Content recommendation
49
Content-based filtering
~
“Content like this”
Collaborative filtering
“Customers who were interested in this product also bought …”
Community-based filtering
~
“Customers like you also bought …”
Stereotype-based filtering
Recommendation combines content cluster with affinity vectors
Rock
Pop
R&B
Context-based filtering
Recommendation depends on location, time, mood, environment …
Hybrid filteringIncreasing recommendation quality by combining
methods for qualifying behaviors
30/05/2011Nicolas Pastorino - IPCse11
Content recommendation
49
Content-based filtering
~
“Content like this”
Collaborative filtering
“Customers who were interested in this product also bought …”
Community-based filtering
~
“Customers like you also bought …”
Stereotype-based filtering
Recommendation combines content cluster with affinity vectors
Rock
Pop
R&B
Context-based filtering
Recommendation depends on location, time, mood, environment …
Hybrid filteringIncreasing recommendation quality by combining
methods for qualifying behaviors
+ A/B testing + near cold-start recommendations
30/05/2011Nicolas Pastorino - IPCse11
Content recommendation
50
30/05/2011Nicolas Pastorino - IPCse11
Content recommendation
50
I/O through REST
Native connection with any HTTP-enabled client ( simple with PHP, native extension for eZ Publish CMS )
Cloud-based : scales
Different methods for event tracking : JS, built-in the CMS,
Famous Last Slides
51
RECAP
RECAP
Multichannel emotion
RECAP
Multichannel emotionREST
RECAP
Multichannel emotionREST
Extensible REST API
RECAP
Multichannel emotionREST
Extensible REST APIContent recommendation
eZ Communityhttp://share.ez.no
eZ Publish Community Projecthttps://github.com/ezsystems/ezpublishhttp://share.ez.no/download http://share.ez.no/get-involved
YooChoose, recommendation enginehttp://www.yoochoose.com
eZ Systems & eZ Publish Enterprise Editionhttp://ez.no
Find me on Twitter : @jeanvoye
Rate this talk : http://joind.in/3852 Slides available soon at http://slideshare.net/jeanvoye
Thank you !