<p>Declared in "<aclass="reference external"href="../include/libtorrent/rss.hpp">libtorrent/rss.hpp</a>"</p>
<p>represents one item from an RSS feed. Specifically
a feed of torrents.</p>
<preclass="literal-block">
struct feed_item
{
<strong>feed_item</strong> ();
<strong>~feed_item</strong> ();
std::string url;
std::string uuid;
std::string title;
std::string description;
std::string comment;
std::string category;
size_type size;
torrent_handle handle;
sha1_hash info_hash;
};
</pre>
<aname="url"></a>
<aname="uuid"></a>
<aname="title"></a>
<aname="description"></a>
<aname="comment"></a>
<aname="category"></a><dlclass="docutils">
<dt>url uuid title description comment category</dt>
<dd>these are self explanatory and may be empty if the feed does not specify
those fields.</dd>
</dl>
<aname="size"></a><dlclass="docutils">
<dt>size</dt>
<dd>the total size of the content the torrent refers to, or -1
if no size was specified by the feed.</dd>
</dl>
<aname="handle"></a><dlclass="docutils">
<dt>handle</dt>
<dd>the handle to the torrent, if the <aclass="reference external"href="reference-Session.html#session">session</a> is already downloading
this torrent.</dd>
</dl>
<aname="info_hash"></a><dlclass="docutils">
<dt>info_hash</dt>
<dd>the info-hash of the torrent, or cleared (i.e. all zeroes) if
the feed does not specify the info-hash.</dd>
</dl>
<aname="feed_settings"></a></div>
<divclass="section"id="feed-settings">
<h1>feed_settings</h1>
<p>Declared in "<aclass="reference external"href="../include/libtorrent/rss.hpp">libtorrent/rss.hpp</a>"</p>
<p>the <aclass="reference external"href="reference-RSS.html#feed_settings">feed_settings</a> object is all the information
and configuration for a specific feed. All of
these settings can be changed by the user
after adding the feed</p>
<preclass="literal-block">
struct feed_settings
{
<strong>feed_settings</strong> ();
std::string url;
bool auto_download;
bool auto_map_handles;
int default_ttl;
add_torrent_params add_args;
};
</pre>
<aname="auto_download"></a><dlclass="docutils">
<dt>auto_download</dt>
<dd>By default <ttclass="docutils literal">auto_download</tt> is true, which means all torrents in
the feed will be downloaded. Set this to false in order to manually
add torrents to the <aclass="reference external"href="reference-Session.html#session">session</a>. You may react to the <aclass="reference external"href="reference-Alerts.html#rss_alert">rss_alert</a> when
a feed has been updated to poll it for the new items in the feed
when adding torrents manually. When torrents are added automatically,
an <aclass="reference external"href="reference-Alerts.html#add_torrent_alert">add_torrent_alert</a> is posted which includes the torrent handle
as well as the error code if it failed to be added. You may also call
<ttclass="docutils literal"><spanclass="pre">session::get_torrents()</span></tt> to get the handles to the new torrents.</dd>
<dd><ttclass="docutils literal">auto_map_handles</tt> defaults to true and determines whether or
not to set the <ttclass="docutils literal">handle</tt> field in the <aclass="reference external"href="reference-RSS.html#feed_item">feed_item</a>, returned
as the feed status. If auto-download is enabled, this setting
is ignored. If auto-download is not set, setting this to false
will save one pass through all the feed items trying to find
corresponding torrents in the <aclass="reference external"href="reference-Session.html#session">session</a>.</dd>
</dl>
<aname="default_ttl"></a><dlclass="docutils">
<dt>default_ttl</dt>
<dd>The <ttclass="docutils literal">default_ttl</tt> is the default interval for refreshing a feed.
This may be overridden by the feed itself (by specifying the <ttclass="docutils literal"><ttl></tt>
tag) and defaults to 30 minutes. The field specifies the number of
minutes between refreshes.</dd>
</dl>
<aname="add_args"></a><dlclass="docutils">
<dt>add_args</dt>
<dd>If torrents are added automatically, you may want to set the
<ttclass="docutils literal">add_args</tt> to appropriate values for download directory etc.
This object is used as a template for adding torrents from feeds,
but some torrent specific fields will be overridden by the
individual torrent being added. For more information on the
<aclass="reference external"href="reference-Session.html#add_torrent_params">add_torrent_params</a>, see <aclass="reference external"href="reference-Session.html#async_add_torrent()">async_add_torrent()</a> and <aclass="reference external"href="reference-Session.html#add_torrent()">add_torrent()</a>.</dd>
</dl>
<aname="feed_status"></a></div>
<divclass="section"id="feed-status">
<h1>feed_status</h1>
<p>Declared in "<aclass="reference external"href="../include/libtorrent/rss.hpp">libtorrent/rss.hpp</a>"</p>
<p>holds information about the status of an RSS feed. Retrieved by
calling <aclass="reference external"href="reference-RSS.html#get_feed_status()">get_feed_status()</a> on <aclass="reference external"href="reference-RSS.html#feed_handle">feed_handle</a>.</p>
<preclass="literal-block">
struct feed_status
{
<strong>feed_status</strong> ();
std::string url;
std::string title;
std::string description;
time_t last_update;
int next_update;
bool updating;
std::vector<feed_item> items;
error_code error;
int ttl;
};
</pre>
<aname="url"></a><dlclass="docutils">
<dt>url</dt>
<dd>the URL of the feed.</dd>
</dl>
<aname="title"></a><dlclass="docutils">
<dt>title</dt>
<dd>the name of the feed (as specified by the feed itself). This
may be empty if we have not recevied a response from the RSS server yet,
or if the feed does not specify a title.</dd>
</dl>
<aname="description"></a><dlclass="docutils">
<dt>description</dt>
<dd>the feed description (as specified by the feed itself).
This may be empty if we have not received a response from the RSS server
yet, or if the feed does not specify a description.</dd>
</dl>
<aname="last_update"></a><dlclass="docutils">
<dt>last_update</dt>
<dd>the posix time of the last successful response from the feed.</dd>
</dl>
<aname="next_update"></a><dlclass="docutils">
<dt>next_update</dt>
<dd>the number of seconds, from now, when the feed will be
updated again.</dd>
</dl>
<aname="updating"></a><dlclass="docutils">
<dt>updating</dt>
<dd>true if the feed is currently being updated (i.e. waiting for
DNS resolution, connecting to the server or waiting for the response to the
HTTP request, or receiving the response).</dd>
</dl>
<aname="items"></a><dlclass="docutils">
<dt>items</dt>
<dd>a vector of all items that we have received from the feed. See
<aclass="reference external"href="reference-RSS.html#feed_item">feed_item</a> for more information.</dd>
</dl>
<aname="error"></a><dlclass="docutils">
<dt>error</dt>
<dd>set to the appropriate error code if the feed encountered an
error. See error_code for more info.</dd>
</dl>
<aname="ttl"></a><dlclass="docutils">
<dt>ttl</dt>
<dd>the current refresh time (in minutes). It's either the configured
default ttl, or the ttl specified by the feed.</dd>
</dl>
<aname="feed_handle"></a></div>
<divclass="section"id="feed-handle">
<h1>feed_handle</h1>
<p>Declared in "<aclass="reference external"href="../include/libtorrent/rss.hpp">libtorrent/rss.hpp</a>"</p>
<p>The <ttclass="docutils literal">feed_handle</tt> refers to a specific RSS feed that is watched by the <aclass="reference external"href="reference-Session.html#session">session</a>.</p>
<p>given a <aclass="reference external"href="reference-RSS.html#feed_item">feed_item</a><ttclass="docutils literal">f</tt>, add the torrent it refers to to <aclass="reference external"href="reference-Session.html#session">session</a><ttclass="docutils literal">s</tt>.</p>
<aname="new_feed()"></a></div>
<divclass="section"id="new-feed">
<h2>new_feed()</h2>
<p>Declared in "<aclass="reference external"href="../include/libtorrent/rss.hpp">libtorrent/rss.hpp</a>"</p>