Skip to content

Instantly share code, notes, and snippets.

@hi-upchen
hi-upchen / tw-p8-rss-article-matrix-api.amp
Last active March 3, 2022 02:22
This script grabs the articles from P8 and save the articles data into data extension (tw-p8-rss-article-matrix)
%%[
SET @xml = HTTPGet("https://www.greenpeace.org/taiwan/feed")
SET @xml = Replace(@xml,'media:thumbnail','mediathumbnail')
SET @nodes = BuildRowsetFromXML(@xml,"//item",0)
SET @rowCount = RowCount(@nodes)
IF @rowCount > 0 THEN
FOR @i = 1 TO @rowCount DO
VAR @title, @desc, @link, @pubDate, @thumbnail
SET @titleRows = BuildRowsetFromXML(@xml,'//item/title',0)