import requests import time def extract_articles(urls): """Extract content from multiple articles.""" articles = [] for url in urls: response = requests.get( "https://api.ujeebu.com/extract", headers={"ApiKey": "YOUR_API_KEY"}, params={"url": url}) if response.status_code == 200: data = response.json() article = data["article"] articles.append({ 'url': url, 'title': article.get('title'), 'author': article.get('author'), 'pub_date': article.get('pub_date'), 'text': article.get('text'), 'language': article.get('language') }) time.sleep(1) # Rate limiting return articles # Extract from multiple URLs urls = [ "https://blog.example.com/article-1", "https://blog.example.com/article-2", "https://news.example.com/story" ] articles = extract_articles(urls) print(f"Extracted {len(articles)} articles")