Вопрос

I'm working on a app that collects random pictures from flickr to use as placeholder images. I just had an incident with a client where one of the placeholders images was too explicit and now I think it is better to filter the results. I know flickr does have a safety level on the images.

As far as I got the safety level is set per user. Is it possible to set it during an API call?

This is the call I'm using:

flickr.interestingness.getList
Это было полезно?

Решение

There is a 'safe search' argument you can pass in when setting your search parameters.

Safe search setting:

  1. for safe
  2. for moderate
  3. for restricted

Your code should look like this:

NSMutableDictionary *params = [NSMutableDictionary new];
[params setObject:@(1) forKey:@"content_type"];

safe_search (Optional) Safe search setting: 1 for safe. 2 for moderate. 3 for restricted.

Click here for more details from the flickr api website

Другие советы

Flickr API does have options for filtering search results via the "safe_search" setting.
Values -
1. for safe
2. for moderated
3. for restricted

But unfortunately there are many photos that are uploaded and not been marked as unsafe. So even though this setting will filter results at some level but its not completely reliable.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top