DjangoGirls / djangogirls

Website for DjangoGirls.org
http://djangogirls.org/
BSD 3-Clause "New" or "Revised" License
462 stars 283 forks source link

Flickr integration to select more diverse photos #625

Closed amakarudze closed 2 years ago

amakarudze commented 3 years ago

When a new event is created, stock pictures already in the system are used as thumbnails for the event on the homepage as well as on the event homepage. However, these stock images are not as diverse and sometimes do not represent the event well. It would be great for the website to be integrated to the Django Girls Flickr account so that we have more diverse images to use.

Eloisa-R commented 2 years ago

Hi!

I’m Eloisa, a frontend developer who attended a Django Girls event a few years back. I really enjoyed my time then and I wanted to contribute to the project, so I opened the PR #709 for this feature.

A couple of caveats:

  1. While developing, I used my own Flickr API key, if you don’t have one you can request one here: https://www.flickr.com/services/apps/create/apply/. And then you will just need to set it as the value for the environment variable FLICKR_API_KEY.

  2. I wasn’t sure about the criteria for selecting the photos, so I decided to call this method https://www.flickr.com/services/api/flickr.people.getPublicPhotos.html and then from the first page of results choose four random photos. I did filter out the photos that were in portrait format because I didn’t think they would fit well with the design of the page, but other than that it’s just random. I guess an improvement that could be made is getting photos from other pages as well, but I wasn’t sure if that was needed, so for now I left it like that.

  3. I am more used to programming in Javascript than Python so I’m open to any feedback that you might have :)

Please let me know if there are any questions or comments!