lib/ayadn/post.rb in ayadn-1.5.1 vs lib/ayadn/post.rb in ayadn-1.6.0
- old
+ new
@@ -40,9 +40,49 @@
def send_nowplaying dic
send_content(Endpoints.new.posts_url, payload_nowplaying(dic))
end
+ def send_movie dic
+ send_content(Endpoints.new.posts_url, payload_movie(dic))
+ end
+
+ def send_tvshow dic
+ send_content(Endpoints.new.posts_url, payload_tvshow(dic))
+ end
+
+ def payload_movie dic
+ ann = annotations_embedded(dic)
+ ann << {
+ "type" => "com.ayadn.movie",
+ "value" => {
+ "title" => dic['title'],
+ "source" => dic['source']
+ }
+ }
+ {
+ "text" => dic['text'],
+ "entities" => entities,
+ "annotations" => ann
+ }
+ end
+
+ def payload_tvshow dic
+ ann = annotations_embedded(dic)
+ ann << {
+ "type" => "com.ayadn.tvshow",
+ "value" => {
+ "title" => dic['title'],
+ "source" => dic['source']
+ }
+ }
+ {
+ "text" => dic['text'],
+ "entities" => entities,
+ "annotations" => ann
+ }
+ end
+
def payload_nowplaying dic
ann = annotations()
if dic['visible'] == true
ann << {
"type" => "com.ayadn.nowplaying",