gchar *language;
gchar *author;
gchar *generator;
+ gchar *link;
time_t date;
guint timeout;
gchar *feed_get_language(Feed *feed);
gchar *feed_get_author(Feed *feed);
gchar *feed_get_generator(Feed *feed);
+gchar *feed_get_link(Feed *feed);
gchar *feed_get_fetcherror(Feed *feed);
gchar *feed_get_cookies_path(Feed *feed);
/* Start of author info for the feed found.
* Set correct location. */
ctx->location = FEED_LOC_ATOM10_AUTHOR;
+ } else if( !strcmp(el, "link") ) {
+ /* Link tag for the feed */
+ g_free(ctx->feed->link);
+ ctx->feed->link = g_strdup(feed_parser_get_attribute_value(attr, "href"));
} else ctx->location = FEED_LOC_ATOM10_NONE;
} else if( ctx->depth == 2 ) {
{
FeedParserCtx *ctx = (FeedParserCtx *)data;
Feed *feed = ctx->feed;
- gchar *text = NULL;
+ gchar *text = NULL, *tmp;
if( ctx->str != NULL )
text = ctx->str->str;
* add a complete item to feed */
if( !strcmp(el, "entry") ) {
+ /* Fix up URL, if it is relative */
+ if (!strstr("://", ctx->curitem->url) &&
+ ctx->feed->link != NULL) {
+ tmp = g_strconcat(ctx->feed->link,
+ (ctx->curitem->url[0] == '/' ? "" : "/"),
+ ctx->curitem->url, NULL);
+ feed_item_set_url(ctx->curitem, tmp);
+ g_free(tmp);
+ }
+
/* append the complete feed item */
if( ctx->curitem->id && ctx->curitem->title
&& ctx->curitem->date_modified ) {