User:Flickr upload bot/step-by-step

A step by step guide of Flickr upload bot

  • Step 1. User submits a username and link to Flickr.
    • The submitted link is scanned for the photo_id. All possible variations of links should be recognized, including deep links to the image source.
    • Information is fetched from Flickr.
      • Error is returned if the image does not exists/is private.
      • Error is returned if the image is unfree.
    • User limit is checked.
      • Error is returned if the user has more than 6 uploads the last hour.
      • Username is checked against the Commons database on the Toolserver. Error is returned if the registration date is later than 4 days ago (and not NULL) and user_editcount is less than 50. This function is subject to replag. Due to this replag, legitimate users may be locked out.
      • TODO: Per user permissions and higher limits for admins.
    • Existence of the image on Commons is checked against FlickreviewR's image database. A warning if the image exists.
    • The form for the second step is prepared using information from Flickr.
      • TODO: Integrate with Duesentrieb's tools for categories.
  • Step 2. User submits a form with filename, description and categories.
    • Information about the picture is again fetched, and license is checked again.
    • Check whether the specified filename already exists. Returns to form if this is the case. Subject to replag.
    • Bad characters are stripped from filename, .jpg is appended if not there yet.
    • Timestamp, reviewer, and photo_id are saved to database.
    • The row id in the database is returned as token.
    • {{Flickr}} is prepared, the token is added and outputted.
  • Step 3. The user is automatically redirected to Commons, using Javascript.
  • Step 4. The user saves the prepared data to Commons, including the token.
  • Step 5. The user returns to the web interface.
    • User limit is checked again against database. Subject to replag.
    • License is checked against Flickr.
    • Last revision of the image description page is fetched from Commons (live). User is checked against previously saved information. Token is checked to be belonging to this user and image.
    • Image description page is edited to add the template and license.
    • Image is added to FlickreviewR's database of Flickr images.
    • Success message is outputted to the user.
      • Meanwhile, the uploader is forked.
      • Highest resolution is fetched from Flickr.
      • If the file is the original, the rotation flag is checked, and the image is losslessy rotated using jpegtran.
      • Image is uploaded to Commons.