Created
June 8, 2021 05:51
-
-
Save anooj-gandham/61bef3cb238f89af1f54c9625d9c96b4 to your computer and use it in GitHub Desktop.
Search RSS/Feed url for a list of blogs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import time | |
from feedsearch import search | |
all_blogs = pd.read_csv('allBlogs') | |
no_res = [] | |
url_res,url_rss = [],[] | |
for i in range(len(all_blogs)): | |
u = all_blogs['url_1'][i] | |
print(i) | |
try: | |
feeds = search(u) | |
urls = [] | |
for j in range(len(feeds)): | |
urls.append(feeds[j].url) | |
if len(urls) != 0: | |
url_res.append(u) | |
url_rss.append(urls) | |
else: | |
no_res.append(u) | |
except : | |
no_res.append(u) | |
rss_checked = pd.DataFrame() | |
rss_checked['url'] = url_res | |
rss_checked['rss'] = url_rss | |
no_result = pd.DataFrame() | |
no_result['url'] = no_res | |
rss_checked.to_csv('rss_results.csv',index=False) | |
no_result.to_csv('no_result.csv',index=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment