Skip to content

Commit

Permalink
Add chronologic output to examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
therealadam committed Aug 13, 2011
1 parent df0c312 commit fb38052
Showing 1 changed file with 89 additions and 6 deletions.
95 changes: 89 additions & 6 deletions slides/04_examples.md
Expand Up @@ -33,6 +33,21 @@
puts "That event looks just like this:"
pp feed['items'].first

<!SLIDE code>

We found 1 events.
That event looks just like this:
{"data"=>
{"body"=>
"There is currently a cat perched on my arm. This is normal, carry on!",
"headline"=>"First ever post in Chronologic!",
"lede"=>"A monumental occasion for housecats everywhere."},
"timestamp"=>"Sat Aug 13 15:57:21 UTC 2011",
"subevents"=>[],
"key"=>"story_1",
"objects"=>{},
"timelines"=>["home"]}

<!SLIDE center>

<!SLIDE full-page center>
Expand Down Expand Up @@ -66,9 +81,21 @@

feed = connection.timeline("home")

puts "Home has #{feed['count']} events."
pp feed['items'].first

<!SLIDE code>

{"data"=>
{"body"=>
"There is currently a cat perched on my arm. This is normal, carry on!",
"headline"=>"First ever post in Chronologic!",
"lede"=>"A monumental occasion for housecats everywhere."},
"timestamp"=>"Sat Aug 13 15:58:29 UTC 2011",
"subevents"=>[],
"key"=>"story_1",
"objects"=>{},
"timelines"=>["tech"]}

<!SLIDE center>

# Events beget subevents
Expand Down Expand Up @@ -109,6 +136,25 @@

pp feed['items'].first

<!SLIDE code>

{"data"=>
{"body"=>
"There is currently a cat perched on my arm. This is normal, carry on!",
"headline"=>"First ever post in Chronologic!",
"lede"=>"A monumental occasion for housecats everywhere."},
"timestamp"=>"Sat Aug 13 16:00:17 UTC 2011",
"subevents"=>
[{"data"=>{"parent"=>"story_1", "message"=>"LOL cats!"},
"timestamp"=>"Sat Aug 13 16:00:17 UTC 2011",
"subevents"=>[],
"timelines"=>["story_1"],
"objects"=>{},
"key"=>"comment_1"}],
"key"=>"story_1",
"objects"=>{},
"timelines"=>["home"]}

<!SLIDE center>
# Events reference objects

Expand Down Expand Up @@ -162,6 +208,25 @@

pp feed['items'].first

<!SLIDE code>

{"data"=>
{"body"=>
"There is currently a cat perched on my arm. This is normal, carry on!",
"headline"=>"First ever post in Chronologic!",
"lede"=>"A monumental occasion for housecats everywhere."},
"timestamp"=>"Sat Aug 13 16:01:48 UTC 2011",
"subevents"=>
[{"data"=>{"parent"=>"story_1", "message"=>"LOL cats!"},
"timestamp"=>"Sat Aug 13 16:01:48 UTC 2011",
"subevents"=>[],
"timelines"=>["story_1"],
"objects"=>{"author"=>[{"name"=>"Fred Derp"}]},
"key"=>"comment_1"}],
"key"=>"story_1",
"timelines"=>["home"],
"objects"=>{"author"=>[{"name"=>"Adam"}]}}

<!SLIDE center>

# A familiar social application
Expand Down Expand Up @@ -239,13 +304,31 @@

@@@ ruby
feed = connection.timeline("friends:rs")
pp feed['items'].first
pp feed

feed = connection.timeline("friends:am")
pp feed['items'].first
# Identical data
connection.timeline("friends:am")
connection.timeline("friends:mt")

feed = connection.timeline("friends:mt")
pp feed['items'].first
<!SLIDE code>

{"items"=>
[{"data"=>{"message"=>"I'm giving a talk!"},
"timestamp"=>"Sat Aug 13 16:05:02 UTC 2011",
"subevents"=>
[{"data"=>{"parent"=>"checkin:1", "message"=>"Me too!"},
"timestamp"=>"Sat Aug 13 16:05:02 UTC 2011",
"subevents"=>[],
"timelines"=>["checkin:1"],
"objects"=>{"user"=>[{"long_name"=>"Richard Schneeman"}]},
"key"=>"comment:1"}],
"key"=>"checkin:1",
"objects"=>
{"spots"=>[{"name"=>"Lone Star Ruby Conference"}],
"user"=>[{"long_name"=>"Adam Keys"}]},
"timelines"=>["passport:ak"]}],
"next_page"=>"00000000-0000-0000-0004-aa6531470780",
"count"=>1}


<!SLIDE full-page center>
Expand Down

0 comments on commit fb38052

Please sign in to comment.