import feedparser from google.oauth2 import service_account from googleapiclient.discovery import build # Load the credentials for the Google account that owns the blogspot site creds = service_account.Credentials.from_service_account_file('path/to/credentials.json') # Create a client for the Google Blogger API blogger = build('blogger', 'v3', credentials=creds) # Get the latest posts from the TechCrunch RSS feed feed = feedparser.parse('https://techcrunch.com/feed/') latest_post = feed.entries[0] # Create a blog post on the blogspot site with the content of the latest TechCrunch post blog_id = 'YOUR_BLOG_ID' # Replace with the ID of your blog post_title = latest_post.title post_content = latest_post.summary post = { 'title': post_title, 'content': post_content, 'labels': ['techcrunch'] # Add a label to identify the source of the post } blogger.posts().insert(blogId=blog_id, body=post).execute()
No posts.
No posts.