Giphy / GiphyAPI

Public facing API docs, notes and more
1.9k stars 282 forks source link

Random GIF API Endpoint behaving...strangely #228

Open GusThal opened 3 years ago

GusThal commented 3 years ago

Hey Giphy team,

I've got kind of a weird use case with an app i'm working on, and i've stumbled onto some strange behavior with the Random API Endpoint.

I've been using the Random Endpoint without any tags, and noticed a lot of the GIFs the API was generating looked similar, and seemed pretty obscure. So in order to get "higher quality" random GIFs, I added a check in my code to only use Random GIFs that had trended in the past.

I next noticed a lot of the GIFs I'd been generating had never trended in the past, so I avoided GIFs where the trending datetime is equal to "0000-00-00 00:00:00." Then I noticed my code was only getting GIFs with a trending datetime of "1970-01-01 00:00:00." Most of these seemed to be from the user "@steppypants", which is some obscure video game. So I added a check to filter out "1970-01-01 00:00:00" trending datetimes, and sure enough my code seems to be looping infinitely when looking for a random GIF that didn't trend at "1970-01-01 00:00:00" and "0000-00-00 00:00:00"

This is uh, pretty strange.

Let me know if you need any clarification or anything. Thanks!