lib/writer/fetcher-microdata/user_comments.rb in fetcher-microdata-0.0.12 vs lib/writer/fetcher-microdata/user_comments.rb in fetcher-microdata-0.0.13
- old
+ new
@@ -10,11 +10,11 @@
def hash
@attributes = @source.attributes
aux = @attributes[:id].split("_")
url = "https://www.facebook.com/#{aux[1]}?comment_id=#{aux[2]}"
- {
+ resp = {
"type" => [@source._type],
"properties" => {
"additionalType" => [
@attributes[:additionalType]
],
@@ -32,11 +32,18 @@
],
"url" => [
url
]
}
-
}
+
+ resp["properties"].keys.each do |att|
+ if resp["properties"]["#{att}"] == [nil]
+ resp["properties"].delete "#{att}"
+ end
+ end
+ resp
+
end
end
end
end
end
\ No newline at end of file