Exemplo n.º 1
0
rss_file *rss_open_url(const char *url, int debug)
{
  rss_file *f;
  gchar *rss_filename;

  if (write_by_temporary_file(NULL, _rss_open_url_cb, (gpointer)url, &rss_filename, debug))
    return NULL;

  f = rss_open_file(rss_filename);

  unlink(rss_filename);
  g_free(rss_filename);

  return f;
}
Exemplo n.º 2
0
static rss_file *_get_rss(channel *c, void *user_data, channel_callback cb, int debug)
{
  rss_file *f;

  if (cb)
    cb(user_data, CCA_RSS_DOWNLOAD_START, NULL, NULL, NULL);

  if (!strncmp("http://", c->url, strlen("http://"))
      || !strncmp("https://", c->url, strlen("https://")))
    f = rss_open_url(c->url, debug);
  else
    f = rss_open_file(c->url);

  if (cb)
    cb(user_data, CCA_RSS_DOWNLOAD_END, &(f->channel_info), NULL, NULL);

  return f;
}