문제

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