Skip to content

Instantly share code, notes, and snippets.

@tcope25
Created September 27, 2023 16:38
Show Gist options
  • Save tcope25/28ebdbc1c9df9da2dfa9cd04b52944a1 to your computer and use it in GitHub Desktop.
Save tcope25/28ebdbc1c9df9da2dfa9cd04b52944a1 to your computer and use it in GitHub Desktop.
python script to get mediavine travel bloggers
import urllib.request, json, csv
sellers = urllib.request.urlopen("https://www.mediavine.com/sellers.json")
data = json.load(sellers)
csv_file = "domains.csv"
sites = []
for item in data["sellers"]:
site = item.get("domain")
if 'travel' in site:
sites.append(site)
with open(csv_file, "w", newline="") as csvfile:
csv_writer = csv.writer(csvfile)
for site in sites:
csv_writer.writerow([site])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment