blogpost submodule¶
This module is used to represent all kinds of informations about blogposts.
-
class
abclinuxuapi.blogpost.Rating¶ Bases:
abclinuxuapi.blogpost.RatingContainer holding informations about rating.
-
rating¶ int – Percentual rating of the blogpost.
-
base¶ int – How many people voted.
-
-
class
abclinuxuapi.blogpost.Tag(tag, norm=None)¶ Bases:
strEach blog may have many tags. This is container for informations about each tag.
-
tag¶ str – Human readable content of the tag.
-
norm¶ str – norm machine-readable version of tag.
-
url¶
-
-
class
abclinuxuapi.blogpost.Blogpost(url, lazy=True, **kwargs)¶ Bases:
objectInformations about blogposts.
-
url¶ str – Absolute URL of the blogpost.
-
uid¶ int – Unique identificator of the blogpost.
-
title¶ str – Tile of the blogpost.
-
intro¶ str – Perex. This is parsed only when returned from
User.
-
text¶ str – Full text of the blogpost.
list – List of
Tagobjects.
-
has_tux¶ bool – Does this blog have a tux? Only good blogs get tux.
-
comments¶ list – List of
Commentobjects. Not used untilpull()is called, or lazy parameter of__init__()is set toTrue.
-
comments_n¶ int – Number of comments. This information is in some cases known before the blog is parsed, just from perex.
-
readed¶ int – How many times was the blog readed?
-
object_ts¶ int – Timestamp of the creation of this object.
-
created_ts¶ int – Timestamp of the creation of the blogpost.
-
last_modified_ts¶ int – Timestamp of the last modification of blogpost.
Parameters: -
static
from_html(html, lazy=True)¶ Convert HTML string to
Blogpostinstance.Parameters: Returns: Blogpostinstance.Return type: obj
-
tags
-
relative_url¶
-
pull()¶ Download page with blogpost. Parse text, comments and everything else.
Until this is called, following attributes are not known/parsed:
-
get_image_urls()¶ Get list of links to all images used in this blog.
Returns: List of str containing absolute URL of the image. Return type: list
-
add_tag(tag)¶ Add new tag to the blogpost.
Parameters: tag (Tag) –
Taginstance. Seepossible_tagsfor list of all possible tags.Raises: Returns: List of
Tagobjects.Return type:
-
remove_tag(tag, throw=False)¶ Remove tag from the tags currently assigned to blogpost.
Parameters: - tag (Tag) –
Taginstance. Seepossible_tagsfor list of all possible tags. - throw (bool) – Raise error in case you are trying to remove tag that is not assigned to blogpost.
Raises: Returns: List of
Tagobjects.Return type: - tag (Tag) –
-