Newsources¶
Remember instance an object of FouryouseeAPI, according
to the basic set up
Getting the newsources¶
- fouryousee.FouryouseeAPI.get_newsources(self, **kwargs) List¶
Get the newsources (Rss Feeds) of the 4YouSee account.
- Parameters
id (int, optional) – Id of the newsource.
name (str, optional) – Newsource name or part of it to search.
template (int, optional) – Template id to search.
insertContentAutomatically (str, optional) – 0 if search only automatic content and 1 for manual.
- Returns
List of dicts, where every dict, depicts a newsource.
- Return type
list
Usage
Once “my” object has been created. You can execute the next:
Getting all the newsources. It will return all the newsources of your account. It will be a list of dicts. If there is no newsources will return a empty list.
>>> my.get_newsources() [ { "id":100, "name":"Twitter Revista Semana (Vertical)", "url":"/rotinas/canal_obter_rss.php?idcanal=31", "template":91, "onlyWithImages":"Yes", "limit":10, "daysToExpire":1, "weight":1, "variables":"None", "approveAutomatically":"Yes", "insertContentAutomatically":true }, { "id":113, "name":"Viajes", "url":"/rotinas/canal_obter_rss.php?idcanal=35", "template":101, "onlyWithImages":"Yes", "limit":10, "daysToExpire":1, "weight":1, "variables":"None", "approveAutomatically":"Yes", "insertContentAutomatically":true }, { "id":48, "name":"Yahoo Weather Colombia", "url":"/rotinas/canal_obter_rss.php?idcanal=14", "template":55, "onlyWithImages":"No", "limit":1, "daysToExpire":1, "weight":1, "variables":"None", "approveAutomatically":"Yes", "insertContentAutomatically":true } ]
If there is no newsources
>>> my.get_newsources() []
If you know the newsource id
>>> my.get_newsource(id=100) [ { "id":100, "name":"Twitter Revista Semana (Vertical)", "url":"/rotinas/canal_obter_rss.php?idcanal=31", "template":91, "onlyWithImages":"Yes", "limit":10, "daysToExpire":1, "weight":1, "variables":"None", "approveAutomatically":"Yes", "insertContentAutomatically":true } ]
If the id doesn’t exists.
>>> my.get_newsources(id=123_456) []
Filtering by template
>>> my.get_newsources(template=91) [ { "id":100, "name":"Twitter Revista Semana (Vertical)", "url":"/rotinas/canal_obter_rss.php?idcanal=31", "template":91, "onlyWithImages":"Yes", "limit":10, "daysToExpire":1, "weight":1, "variables":"None", "approveAutomatically":"Yes", "insertContentAutomatically":true } ]
Filtering by name
>>> my.get_newsources(name='twit') [ { "id":55, "name":"Twitter El Espectador", "url":"/rotinas/canal_obter_rss.php?idcanal=27", "template":63, "onlyWithImages":"Yes", "limit":7, "daysToExpire":1, "weight":1, "variables":"None", "approveAutomatically":"Yes", "insertContentAutomatically":true }, { "id":8, "name":"Twitter El Heraldo", "url":"/rotinas/canal_obter_rss.php?idcanal=4", "template":89, "onlyWithImages":"Yes", "limit":7, "daysToExpire":1, "weight":1, "variables":"None", "approveAutomatically":"Yes", "insertContentAutomatically":true }, { "id":53, "name":"Twitter Noticias Caracol", "url":"/rotinas/canal_obter_rss.php?idcanal=26", "template":62, "onlyWithImages":"Yes", "limit":20, "daysToExpire":1, "weight":1, "variables":"None", "approveAutomatically":"Yes", "insertContentAutomatically":true }, { "id":100, "name":"Twitter Revista Semana (Vertical)", "url":"/rotinas/canal_obter_rss.php?idcanal=31", "template":91, "onlyWithImages":"Yes", "limit":10, "daysToExpire":1, "weight":1, "variables":"None", "approveAutomatically":"Yes", "insertContentAutomatically":true } ]
Filtering by insertContentAutomatically
>>> my.get_newsources(insertContentAutomatically=0) # 0 means False and 1 True [ { "id":116, "name":"Barra Noticias Manual", "url":"", "template":103, "onlyWithImages":"No", "limit":10, "daysToExpire":1, "weight":1, "variables":[ "texto" ], "approveAutomatically":"Yes", "insertContentAutomatically":false }, { "id":49, "name":"Streaming Youtube", "url":"", "template":58, "onlyWithImages":"No", "limit":10, "daysToExpire":1, "weight":1, "variables":[ "videoURL", "tempo" ], "approveAutomatically":"Yes", "insertContentAutomatically":false }, { "id":50, "name":"Ticker texto inferior", "url":"", "template":59, "onlyWithImages":"No", "limit":10, "daysToExpire":1000, "weight":1, "variables":[ "Texto" ], "approveAutomatically":"Yes", "insertContentAutomatically":false } ]
Editing newsources¶
Warning
At the moment of the building of this documentation, the 4YouSee API doesn’t have the endpoint for deleting media categories.
Deleting newsources¶
Warning
At the moment of the building of this documentation, the 4YouSee API doesn’t have the endpoint for deleting media categories.