🖼️

Fetching Wikipedia Commons Photos for WordPress

Mar 28, 2025

Lecture Notes: Fetching and Uploading Wikipedia Commons Photos to WordPress

Overview

  • Objective: Learn how to fetch images from Wikipedia Commons and upload them to WordPress as featured images or content images with proper attributions.
  • Tools Used: make.com, OpenAI's GPT-40, WordPress.

Key Steps

1. Fetching Images from Wikipedia Commons

  • Initialize a Scenario: Start with a blank scenario in make.com.
  • Set Query Variable: Define a variable (e.g., query = 'Birds') which is hardcoded for this example but can be linked to a dynamic source like Airtable or Google Sheets.
  • Construct Request URL: Use a URL from the video description to send requests to Wikipedia Commons with the query variable inserted.
  • Parse Response: Receive and parse results to extract image info and URLs.

2. Handling Image Data

  • Set Image URL Variable: Extract and store the first image URL from the response.
  • Transform Data: Convert response collections to arrays to handle them effectively.

3. Filtering

  • Add Filter: Ensure the process stops if no results are returned by checking if the query pages exist.

Uploading to WordPress

1. Preparing the Image Data

  • Transform to JSON: Use a JSON object to format image data consistently, especially for image URL and attribution.
  • OpenAI GPT-40 Integration: Utilize OpenAI to convert attribution data into a consistent JSON format.

2. Uploading Process

  • HTTP Module: Fetch the image file using the URL prepared from JSON response.
  • Create Media Item in WordPress: Use make.com to upload and ensure filenames are unique by appending timestamps.
  • Get Media Item: Extract publicly accessible URL for the image to use in posts.

3. Creating a WordPress Post

  • Post Setup: Add title, content, and images to the post. Use image URLs within content or as featured media.
  • Attribution Handling: Include image credit with appropriate HTML formatting for attributions. Ensure links are marked "no follow" for SEO.

Tips and Considerations

  • Unique Filenames: Avoid overwriting in WordPress by ensuring filenames are unique.
  • Consistent Attribution: Customize the OpenAI prompt to ensure consistent formatting of image credits.
  • Automation Flexibility: Adjust scenarios to fetch images based on dynamic queries from external sources.

Additional Resources

  • Community & Support: Access additional automation templates and receive support through workshops and discussion boards as linked in the video description.

Ensure to tailor prompts and automation steps to fit specific use cases and integrate seamlessly with existing workflows.