milesmcc / librenews

A free and open breaking news notification platform
https://librenews.io
GNU General Public License v3.0
88 stars 13 forks source link

FR: filter source via get parameter #7

Open mueller-ma opened 7 years ago

mueller-ma commented 7 years ago

E.g. librenews.io/api?source=bbc&source=cnn will return news from bbc and cnn. This would make it possible to use one api server for multiple languages with adding the parameters to the server url string in the android app

milesmcc commented 7 years ago

I think perhaps filtering responses by channels or by offering multiple endpoints is perhaps a better way... don't you think? Channels are pre-defined and static, while sources are variable and not meant to act as filters. I do think that a channel filtration parameter, however, would be appropriate. Thoughts?

mueller-ma commented 7 years ago

Would you use one channel for breaking news for all sources? Or name the channel e.g. "breaking news bbc". IMO latter is better, because multiple sources may report the same event

milesmcc commented 7 years ago

Ultimately, channels are meant to be dynamic (currently they are hard-coded), so I think adopting an approach like 'breaking news bbc' would be appropriate. That's a little further away, though, so I'm going to leave this issue open and wait for the codebase to develop a bit more.

mueller-ma commented 7 years ago

That might be a good option