Skip to content

Commit bda1b57

Browse files
committed
updating to extract all links
1 parent a2a43ef commit bda1b57

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lambdas/security-newsletter/src/handler.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import pytz
88

99

10-
TABLE_ARN = os.environ["DYNAMODB_TABLE_ARN"]
10+
TABLE_ARN = "none"#os.environ["DYNAMODB_TABLE_ARN"]
1111
ARTIFACT_TYPE = "newsletter"
1212

1313
# Logging Configuration
@@ -33,11 +33,10 @@ def main(event, _):
3333

3434
logging.info("Latest articles: %s", latest_articles)
3535

36-
# Extract links from Bleeping Computer articles only
37-
bleeping_links = [article["link"] for article in latest_articles
38-
if "bleepingcomputer.com" in article["link"]]
36+
# Extract links from all articles
37+
newsletter_links = [article["link"] for article in latest_articles]
3938

40-
return publish_message_to_table(bleeping_links)
39+
return publish_message_to_table(newsletter_links)
4140

4241

4342
def get_latest_article_with_timezone(articles, timezone_str="UTC"):
@@ -115,3 +114,7 @@ def publish_message_to_table(links: str):
115114
)
116115
logging.info("Response: %s", response)
117116
return {"message": "Message has been logged to DynamoDB!", "links": links}
117+
118+
if __name__ == "__main__":
119+
feed = fetch_bleeping_computer_rss()
120+
print(feed)

0 commit comments

Comments
 (0)