-
- {:xmlObj, :string, object_type } = :xmerl_xpath.string('string(/entry/activity:object-type[1])', doc)
-
- case object_type do
- 'http://activitystrea.ms/schema/1.0/note' ->
- handle_note(doc)
- _ ->
- Logger.error("Couldn't parse incoming document")
- end
+ entries = :xmerl_xpath.string('//entry', doc)
+
+ activities = Enum.map(entries, fn (entry) ->
+ {:xmlObj, :string, object_type } = :xmerl_xpath.string('string(/entry/activity:object-type[1])', entry)
+
+ case object_type do
+ 'http://activitystrea.ms/schema/1.0/note' ->
+ {:ok, activity} = handle_note(entry, doc)
+ activity
+ _ ->
+ Logger.error("Couldn't parse incoming document")
+ nil
+ end
+ end)
+ {:ok, activities}