Sour
File: sour.py
- class sour.Sour
Bases:
object- autocomplete(q)
Return titles by applying autocomplete to the query text.
- Parameters
q (str) – Query text
- Returns
autocompleteobject
- get_channel(channel, page=1)
Return all titles under the given channel
- Parameters
channel (str) – Name of the channel
page (str, optional) – Page index of the results
- Returns
listofsour_titleobjects
- news(page=1)
Return latest news titles.
- Parameters
page (int, optional) – Page index of the results
- Returns
listofsour_titleobjects
- orphans(page=1)
Return all orphan titles
- Parameters
page (int, optional) – Page index of the results
- Returns
listofsour_titleobjects
- query(q, page=1, nice=False)
Return entries from a page.
- Parameters
q (str) – The query text
page (int, optional) – Page index of the results
nice (boolean, optional) – Option to sort entries by their favorite counts
- Returns
listofsour_entryobjects
- savepage(content)
- search(keywords, author=None, page=1, fromdate=None, todate=None, nice_only=False, sort='Topic')
Return titles that match the query parameters.
- Parameters
keywords (str) – Search keywords
author (str, optional) – Specific author for the titles
page (int, optional) – Page number of the results
fromdate (str, optional) – E.g. 1970-01-01
todate (str, optional) – E.g. 1970-01-01
nice_only (boolean, optional) – Show only top rated titles
sort (str, optional) – ( Topic | Date | Count )
- Returns
listofsour_titleobjects
- throwback(year, page=1)
Return all titles from this day on the given year
- Parameters
year (int) – Year to search for
page (int, optional) – Page index of the results
- Returns
listofsour_titleobjects
- top_rated()
Return highly rated titles from yesterday.
- Returns
listofsour_titleobjects
- class sour.autocomplete(query, titles, nicks)
Bases:
objectautocomplete class that provides titles and nicks from a query.
- query
The search query
- Type
str
- titles
Title results
- Type
list
- nicks
Nick results
- Type
list
- class sour.channel(name, title, href)
Bases:
objectchannel class that provides channel information.
- name
Name of the channel
- Type
str
- title
Title of the channel
- Type
str
- url
URL of the channel
- Type
str
- class sour.sour_entry(entry_id, author_id, author, avatar, fav_count, date, content)
Bases:
objectsour_entry class that provides entry information.
- entry_id
ID of the entry
- Type
int
- author_id
ID of the author
- Type
int
- author
Nickname of the author
- Type
str
- author_avatar
Avatar image of the author
- Type
str
- fav_count
Favorite count of the entry
- Type
int
- url
URL of the entry
- Type
str
- date
Entry date
- Type
str
- content
Content of the entry
- Type
str