M4R774 / bobweb2

Telegram botti piristämään elämää
MIT License
8 stars 1 forks source link

Add more recipes #143

Closed taturl closed 2 years ago

taturl commented 2 years ago

Got more recipies. Text file generated with:

import requests
import xml.etree.ElementTree as ET

index_r = requests.get('https://www.soppa365.fi/sitemap.xml')
index_xml = index_r.text
index_tree = ET.fromstring(index_xml)

for page_url in index_tree.findall('{http://www.sitemaps.org/schemas/sitemap/0.9}sitemap'):
    page_url = page_url.find('{http://www.sitemaps.org/schemas/sitemap/0.9}loc').text
    r = requests.get(page_url)
    xml = r.text
    tree = ET.fromstring(xml)
    for url in tree.findall('{http://www.sitemaps.org/schemas/sitemap/0.9}url'):
        resepti_url = url.find('{http://www.sitemaps.org/schemas/sitemap/0.9}loc').text
        if 'reseptit/kasvis' in resepti_url:
            print(resepti_url)
sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

90.0% 90.0% Coverage
0.0% 0.0% Duplication