script/lib/iri_tweet/export_twitter_alchemy.py
changeset 31 93fd53a97d6d
parent 27 c3ea041c6cde
child 39 c5d7dd0ec4e1
--- a/script/lib/iri_tweet/export_twitter_alchemy.py	Sat Jan 29 06:34:45 2011 +0100
+++ b/script/lib/iri_tweet/export_twitter_alchemy.py	Sun Jan 30 22:10:59 2011 +0100
@@ -199,13 +199,13 @@
                         media_nodes = root.xpath("//media")
                         if len(media_nodes) > 0:
                             media = media_nodes[0]
-                            annotations_node = root.find(u"annotations")
-                            if annotations_node is None:
-                                annotations_node = etree.SubElement(root, u"annotations")
-                            content_node = annotations_node.find(u"content")
-                            if content_node is None:
-                                content_node = etree.SubElement(annotations_node,u"content", id=media["id"])
-                            ensemble_parent = content_node
+                        annotations_node = root.find(u"annotations")
+                        if annotations_node is None:
+                            annotations_node = etree.SubElement(root, u"annotations")
+                        content_node = annotations_node.find(u"content")
+                        if content_node is None:
+                            content_node = etree.SubElement(annotations_node,u"content", id=media.get(u"id"))
+                        ensemble_parent = content_node
                     elif file_type == "iri":
                         body_node = root.find(u"body")
                         if body_node is None: