Skip to content

Commit

Permalink
Requesting with_tags now returns an error.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed May 9, 2018
1 parent df2e33f commit 7e37a7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
11 changes: 1 addition & 10 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@
@type = @edge = %w[videos photos live].pick(params[:type]) || "posts"
@edge = "videos" if @type == "live"
fields = {
"posts" => "updated_time,from,parent_id,type,story,name,message,description,link,source,picture,full_picture,properties,with_tags",
"posts" => "updated_time,from,parent_id,type,story,name,message,description,link,source,picture,full_picture,properties",
"videos" => "updated_time,from,title,description,embed_html,length,live_status",
"photos" => "updated_time,from,message,description,name,link,source",
}[@edge]
Expand All @@ -486,15 +486,6 @@

@data = response.json["data"]
if @edge == "posts"
# Filter posts if with=uid is supplied (property only exists on posts)
if params[:with]
ids = params[:with].split(",")
@data.select! { |post| post["with_tags"] && post["with_tags"]["data"].any? { |tag| ids.include?(tag["id"]) } }
elsif params.has_key?(:with)
# If with is specified but is nil, then we just want to get posts that include someone else
@data.select! { |post| post["with_tags"] }
end

# Copy down video length from properties array
@data.each do |post|
if post["properties"]
Expand Down
4 changes: 3 additions & 1 deletion app/facebook.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true
# https://developers.facebook.com/docs/graph-api/reference/
# https://developers.facebook.com/docs/graph-api/reference
# https://developers.facebook.com/docs/graph-api/changelog
# https://developers.facebook.com/docs/graph-api/changelog/breaking-changes

class FacebookError < HTTPError; end

Expand Down

0 comments on commit 7e37a7c

Please sign in to comment.