Skip to content

Commit

Permalink
Merge branch 'oe1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas0907 committed Aug 12, 2018
2 parents 571c5c4 + e3471f6 commit 8539176
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions feeds/spiders/oe1_orf_at.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,23 @@ def _parse_broadcast(self, response):
image = broadcast["images"][0]["versions"][0]
il.add_value(
"content_html",
'<img src="{image[path]}" width="{image[width]}">'.format(image=image)
'<img src="{image[path]}" width="{image[width]}">'.format(image=image),
)
for item in broadcast["items"]:
if "title" in item:
il.add_value("content_html", "<h3>{}</h3>".format(item["title"]))
il.add_value("content_html", item.get("description"))
il.add_value("content_html", broadcast["description"])
il.add_value(
"content_html",
'<a href="{broadcast[url]}">{broadcast[urlText]}</a>'.format(
broadcast=broadcast
),
)
il.add_value("category", broadcast["tags"])
if "no_canonical_url" not in broadcast["url"]:
yield scrapy.Request(
broadcast["url"], self._parse_show, dont_filter=True, meta={"il": il},
broadcast["url"], self._parse_show, dont_filter=True, meta={"il": il}
)
else:
yield il.load_item()
Expand Down

0 comments on commit 8539176

Please sign in to comment.