- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
<?php
2001-10-20 18:57:09 +00:00
// $Id$
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
2001-05-28 18:53:48 +00:00
function import_help() {
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
?>
2001-12-30 16:16:38 +00:00
<p>In Drupal you have <i>feeds</i> and <i>bundles</i>. Feeds define news sources and bundles categoriz syndicated content by source, topic or any other heuristic. Bundles provide a generalized way of creating composite feeds. They allow you, for example, to combine various sport-related feeds into one bundle called "Sport".</p>
<p>You can have several providers of news feeds. You can add a feed by clicking the "add feed" link on the import administration pages. Give the feed a name, supply the URI and a comma-separated list of attributes that you want to associate the feed with. The update interval defines how often Drupal should go out to try and grab fresh content. The expiration time defines how long syndicated content is kept in the database. So set the update and expiration time and save your settings. You have just defined your first feed. If you have more feeds repeat as necessary.</p>
2002-06-08 10:09:03 +00:00
<p>To verify whether your feed works, press "update items" at the overview page. The number of news items that have been sucessfully fetched, should then become visible in the third column of the feed overview.</p>
2001-12-30 16:16:38 +00:00
<p>Now you have to define some bundles. Bundles look for feeds that contain one of the keywords associated with the bundle and display those feeds together. To define a bundle you have to give it a name and a comma-separated list of keywords just like this is the case for feeds.</p>
<p>Your newly created bundle will now show up in the list of blocks that you can see at the block related administration pages. There you can customize where and when your bundles will be displayed.</p>
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
<?php
}
2002-06-01 21:57:29 +00:00
function import_system($field){
2002-06-08 16:17:29 +00:00
$system["description"] = t("Used to aggregate syndicated content (RSS and RDF).");
2002-06-01 21:57:29 +00:00
return $system[$field];
}
2001-07-11 22:06:24 +00:00
function import_conf_options() {
$number = array(5 => 5, 10 => 10, 15 => 15, 20 => 20, 25 => 25, 30 => 30, 35 => 35, 40 => 40, 45 => 45, 50 => 50, 55 => 55, 60 => 60, 65 => 65, 70 => 70, 75 => 75, 80 => 80, 85 => 85, 90 => 90, 95 => 95, 100 => 100);
2002-06-08 10:09:03 +00:00
$output .= form_select("Items per block", "import_block_limit", variable_get("import_block_limit", 15), $number, "The maximum number of news items displayed in one block.");
$output .= form_select("Items per page", "import_page_limit", variable_get("import_page_limit", 75), $number, "The maximum number of news items displayed on one page.");
2001-12-30 16:16:38 +00:00
2001-07-11 22:06:24 +00:00
return $output;
}
2001-06-20 20:00:40 +00:00
function import_perm() {
2001-07-11 22:06:24 +00:00
return array("administer news feeds", "access news feeds");
2001-06-29 22:08:57 +00:00
}
function import_link($type) {
2001-07-11 22:06:24 +00:00
if ($type == "admin" && user_access("administer news feeds")) {
2002-04-20 11:52:50 +00:00
$links[] = la(t("news feeds"), array("mod" => "import"));
2001-07-11 22:06:24 +00:00
}
if ($type == "page" && user_access("access news feeds")) {
2002-05-12 15:40:57 +00:00
$links[] = lm(t("news feeds"), array("mod" => "import"), "", array("title" => t("Read the latest news from syndicated websites.")));
2001-06-29 22:08:57 +00:00
}
return $links ? $links : array();
2001-06-20 20:00:40 +00:00
}
2001-05-28 18:53:48 +00:00
function import_cron() {
2001-07-11 22:06:24 +00:00
$result = db_query("SELECT * FROM feed WHERE timestamp + refresh < ". time());
while ($feed = db_fetch_array($result)) {
import_refresh($feed);
}
}
function import_update() {
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
$result = db_query("SELECT * FROM feed");
while ($feed = db_fetch_array($result)) {
2001-07-11 22:06:24 +00:00
import_refresh($feed);
}
}
2001-07-14 19:02:36 +00:00
function import_format_item($item, $feed = 0) {
global $theme, $user;
2001-07-12 10:39:15 +00:00
2002-12-10 20:35:20 +00:00
if ($user->uid && user_access("maintain personal blog")) {
2002-05-12 15:40:57 +00:00
$output .= lm("<img src=\"". $theme->image("blog.gif") ."\" border=\"0\" width=\"12\" height=\"16\" alt=\"". t("Blog this item") ."\" />", array("mod" => "node", "op" => "add", "type" => "blog", "iid" => $item->iid), "", array("title" => t("Comment on this news item in your personal blog.")));
2001-07-11 22:06:24 +00:00
}
2002-04-20 11:52:50 +00:00
// external link
2001-07-11 22:06:24 +00:00
$output .= "<a href=\"". check_output($item->link) ."\" target=\"new\">". check_output($item->title) ."</a>";
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
2001-07-11 22:06:24 +00:00
return $output ."<br />";
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
2001-07-11 22:06:24 +00:00
function import_bundle_block($attributes) {
2001-06-11 20:01:13 +00:00
if ($attributes) {
$keys = explode(",", $attributes);
foreach ($keys as $key) $where[] = "attributes LIKE '%". trim($key) ."%'";
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
2001-07-11 22:06:24 +00:00
$result = db_query("SELECT * FROM item WHERE ". implode(" OR ", $where) ." ORDER BY iid DESC LIMIT ". variable_get("import_block_limit", 15));
2001-07-14 19:02:36 +00:00
}
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
2001-07-14 19:02:36 +00:00
while ($item = db_fetch_object($result)) {
$output .= import_format_item($item);
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
2001-07-14 19:02:36 +00:00
return $output;
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
2001-07-11 22:06:24 +00:00
function import_feed_block($feed) {
2002-04-20 11:52:50 +00:00
$result = db_query("SELECT * FROM item WHERE fid = '%s' ORDER BY iid DESC LIMIT ". variable_get("import_block_limit", 15), $feed->fid);
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
2001-07-11 22:06:24 +00:00
while ($item = db_fetch_object($result)) {
2001-07-14 19:02:36 +00:00
$output .= import_format_item($item);
2001-07-09 18:13:53 +00:00
}
2001-07-11 22:06:24 +00:00
2001-07-09 18:13:53 +00:00
return $output;
}
2002-10-26 15:17:26 +00:00
function import_block($op, $delta) {
if ($op == "list") {
$result = db_query("SELECT * FROM bundle ORDER BY title");
while ($bundle = db_fetch_object($result)) {
$block[$bundle->bid]["info"] = "$bundle->title bundle";
}
$result = db_query("SELECT * FROM feed ORDER BY fid");
while ($feed = db_fetch_object($result)) {
$block[$feed->fid]["info"] = "$feed->title feed";
}
return $block;
}
else {
$feed = db_fetch_object(db_query("SELECT * FROM feed WHERE fid = '%d'", $delta));
if ($feed) {
$block["subject"] = $feed->title;
$block["content"] = import_feed_block($feed) ."<p><div align=\"right\">". lm(t("more"), array("mod" => "import", "op" => "feed", "id" => $feed->fid), "", array("title" => t("View this feed's recent news."))) ."</div></p>";
}
else {
// it was a bundle. this is NOT elegant
$bundle = db_fetch_object(db_query("SELECT * FROM bundle WHERE bid = '%d'", $delta));
$block["subject"] = $bundle->title;
$block["content"] = import_bundle_block($bundle->attributes) ."<p><div align=\"right\">". lm(t("more"), array("mod" => "import", "op" => "bundle", "id" => $bundle->bid), "", array("title" => t("View this bundle's recent news."))) ."</div></p>";
}
return $block;
}
2001-07-11 22:06:24 +00:00
}
2001-07-12 16:50:12 +00:00
function import_get_bundles($attributes = 0) {
2001-05-28 18:53:48 +00:00
$result = db_query("SELECT * FROM bundle ORDER BY title");
2001-07-11 22:06:24 +00:00
2001-05-28 18:53:48 +00:00
while ($bundle = db_fetch_object($result)) {
2002-10-26 15:17:26 +00:00
$block[$bundle->bid]["subject"] = $bundle->title;
$block[$bundle->bid]["content"] = import_bundle_block($bundle->attributes) ."<p><div align=\"right\">". lm(t("more"), array("mod" => "import", "op" => "bundle", "id" => $bundle->bid), "", array("title" => t("View this bundle's recent news."))) ."</div></p>";
$block[$bundle->bid]["info"] = "$bundle->title bundle";
2001-05-28 18:53:48 +00:00
}
2001-07-11 22:06:24 +00:00
2001-07-14 19:02:36 +00:00
return $block;
2001-07-11 22:06:24 +00:00
}
2001-07-12 16:50:12 +00:00
function import_get_feeds($attributes = 0) {
2001-07-14 19:02:36 +00:00
$result = db_query("SELECT * FROM feed ORDER BY fid");
2001-07-11 22:06:24 +00:00
while ($feed = db_fetch_object($result)) {
2002-10-26 15:17:26 +00:00
$block[$feed->fid]["subject"] = $feed->title;
$block[$feed->fid]["content"] = import_feed_block($feed) ."<p><div align=\"right\">". lm(t("more"), array("mod" => "import", "op" => "feed", "id" => $feed->fid), "", array("title" => t("View this feed's recent news."))) ."</div></p>";
$block[$feed->fid]["info"] = "$feed->title feed";
2001-07-11 22:06:24 +00:00
}
2001-07-14 19:02:36 +00:00
return $block;
2001-05-28 18:53:48 +00:00
}
2001-06-09 11:05:13 +00:00
function import_remove($feed) {
2002-04-20 11:52:50 +00:00
db_query("DELETE FROM item WHERE fid = '%s'", $feed["fid"]);
2001-12-30 16:16:38 +00:00
return "feed '". $feed["title"] ."' reset.";
2001-06-09 11:05:13 +00:00
}
2001-07-11 22:06:24 +00:00
function import_refresh($feed) {
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
2001-07-15 09:29:22 +00:00
/*
** Check whether the feed is properly configured:
*/
2001-12-30 16:16:38 +00:00
if (!ereg("^http://|ftp://", $feed["url"])) {
watchdog("warning", "import: invalid or missing URL for '". $feed["title"] ."'");
2001-07-15 09:29:22 +00:00
}
/*
2002-01-07 22:08:52 +00:00
** Grab the news items:
2001-07-15 09:29:22 +00:00
*/
2001-12-30 16:16:38 +00:00
if ($fp = @fopen($feed["url"], "r")) {
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
// fetch data:
2001-08-04 13:37:41 +00:00
while (!feof($fp)) {
$data .= fgets($fp, 128);
}
2001-08-05 10:21:32 +00:00
fclose($fp);
2001-07-09 18:13:53 +00:00
// initialize the translation table:
$tt = array_flip(get_html_translation_table(HTML_ENTITIES));
$tt["'"] = "'";
2001-08-04 13:37:41 +00:00
/*
** Remove unsupported tags or sub-elements:
*/
2001-07-15 09:29:22 +00:00
2001-08-04 13:37:41 +00:00
$data = ereg_replace("<textinput([^s].*)</textinput>", "", $data);
$data = ereg_replace("<image([^s].*)</image>", "", $data);
2001-07-15 09:29:22 +00:00
2001-08-04 13:37:41 +00:00
/*
** Extract and process channel information:
*/
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
2001-08-04 13:37:41 +00:00
$channel = ereg_replace("<item([^s].*)</item>", "", $data);
2001-07-15 09:29:22 +00:00
2001-08-04 13:37:41 +00:00
eregi("<title>(.*)</title>", $channel, $title);
eregi("<link>(.*)</link>", $channel, $link);
eregi("<description>(.*)</description>", $channel, $description);
2001-07-09 18:13:53 +00:00
2001-12-30 16:16:38 +00:00
/*
** Strip invalid tags and provide default values (if required):
*/
$link = strip_tags($link[1]);
$description = filter(strtr($description[1], $tt));
2002-04-22 09:05:36 +00:00
db_query("UPDATE feed SET timestamp = '%s', link = '%s', description = '%s' WHERE fid = '%s'", time(), $link, $description, $feed["fid"]);
2001-06-09 11:05:13 +00:00
2001-08-04 13:37:41 +00:00
/*
** Extract and process individual items:
*/
2001-07-09 18:13:53 +00:00
2001-08-04 13:37:41 +00:00
eregi("<item([^s].*)</item>", $data, $data);
// print "<pre>". htmlentities($data[0]) ."</pre>";
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
2001-08-04 13:37:41 +00:00
$items = array_reverse(explode("</item>", $data[0]));
2001-07-11 22:06:24 +00:00
2001-08-04 13:37:41 +00:00
foreach ($items as $item) {
unset($title, $link, $author, $description);
2001-07-07 13:07:03 +00:00
2001-08-04 13:37:41 +00:00
$t = eregi("<title>(.*)</title>", $item, $title);
$l = eregi("<link>(.*)</link>", $item, $link);
$a = eregi("<author>(.*)</author>", $item, $author);
$d = eregi("<description>(.*)</description>", $item, $description);
2001-07-15 09:29:22 +00:00
2001-08-04 13:37:41 +00:00
if ($t || $l || $a || $d) {
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
2001-08-04 13:37:41 +00:00
/*
** Strip invalid tags and provide default values (if required):
*/
2001-07-18 11:28:05 +00:00
2001-08-04 13:37:41 +00:00
$title = strip_tags(strtr($title[1] ? $title[1] : substr(strip_tags(strtr($description[1], $tt)), 0, 30), $tt));
2001-12-30 16:16:38 +00:00
$link = strip_tags($link[1] ? $link[1] : $feed["link"]);
$author = strip_tags($author[1]);
$description = filter(strtr($description[1], $tt));
2001-07-18 11:28:05 +00:00
2001-08-04 13:37:41 +00:00
// print "<pre>title = ". htmlentities($title) ."\n\ndescription = ". htmlentities($description) ."\n\nlink = ". htmlentities($link) ."</pre><hr />";
2001-07-15 09:29:22 +00:00
2001-08-04 13:37:41 +00:00
/*
2002-01-05 21:48:14 +00:00
** Save this item. Try to avoid duplicate entries as much as
** possible. If we find a duplicate entry, we resolve it and
** pass along its ID such that we can update it (when needed).
2001-08-04 13:37:41 +00:00
*/
2001-08-03 18:39:17 +00:00
2002-01-05 21:48:14 +00:00
if ($link && $link != $feed["link"] && $link != $feed["url"]) {
2002-04-20 11:52:50 +00:00
$entry = db_fetch_object(db_query("SELECT iid FROM item WHERE fid = '%s' AND link = '%s'", $feed["fid"], $link));
2002-01-05 21:48:14 +00:00
}
else {
2002-04-20 11:52:50 +00:00
$entry = db_fetch_object(db_query("SELECT iid FROM item WHERE fid = '%s' AND title = '%s'", $feed["fid"], $title));
2002-01-05 21:48:14 +00:00
}
import_save_item(array(iid => $entry->iid, fid => $feed["fid"], title => $title, link => $link, author => $author, description => $description, attributes => $feed["attributes"]));
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
}
2001-12-24 10:51:25 +00:00
/*
2001-12-30 16:16:38 +00:00
** Remove all the old, expired items:
2001-12-24 10:51:25 +00:00
*/
unset($items);
2002-04-20 11:52:50 +00:00
$result = db_query("SELECT iid FROM item WHERE fid = '%s' ORDER BY timestamp", $feed["fid"]);
2001-12-24 10:51:25 +00:00
while ($item = db_fetch_object($result)) {
$items[] = "iid = '$item->iid'";
}
2001-12-24 11:14:32 +00:00
if (sizeof($items) > 50) {
2001-12-24 10:51:25 +00:00
db_query("DELETE FROM item WHERE ". implode(" OR ", array_slice($items, 0, - 50)));
}
2001-08-04 13:37:41 +00:00
}
else {
2001-12-30 16:16:38 +00:00
watchdog("warning", "import: failed to syndicate from '". $feed["title"] ."'". ($errstr ? ": $errstr" : ""));
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
2001-06-09 11:05:13 +00:00
2001-12-30 16:16:38 +00:00
return "feed '". $feed["title"] ."' updated.";
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
2001-05-28 18:53:48 +00:00
function import_save_item($edit) {
2001-12-30 16:16:38 +00:00
if ($edit["iid"] && $edit["title"]) {
2002-04-20 11:52:50 +00:00
db_query("UPDATE item SET title = '%s', link = '%s', author = '%s', description = '%s', attributes = '%s' WHERE iid = '%s'", $edit["title"], $edit["link"], $edit["author"], $edit["description"], $edit["attributes"], $edit["iid"]);
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
2001-12-30 16:16:38 +00:00
else if ($edit["iid"]) {
2002-04-20 11:52:50 +00:00
db_query("DELETE FROM item WHERE iid = '%s'", $edit["iid"]);
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
2001-12-30 16:16:38 +00:00
else if ($edit["title"] && $edit["link"]) {
2002-04-20 11:52:50 +00:00
db_query("INSERT INTO item (fid, title, link, author, description, attributes, timestamp) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s')", $edit["fid"], $edit["title"], $edit["link"], $edit["author"], $edit["description"], $edit["attributes"], time());
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
}
2001-05-28 18:53:48 +00:00
function import_form_bundle($edit = array()) {
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
2001-12-30 16:16:38 +00:00
$form .= form_textfield("Title", "title", $edit["title"], 50, 64, "The name of the bundle.");
$form .= form_textfield("Attributes", "attributes", $edit["attributes"], 50, 128, "A comma-seperated list of keywords describing the bundle.");
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
$form .= form_submit("Submit");
2001-12-30 16:16:38 +00:00
if ($edit["bid"]) {
2001-09-24 18:46:07 +00:00
$form .= form_submit("Delete");
2001-12-30 16:16:38 +00:00
$form .= form_hidden("bid", $edit["bid"]);
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
2001-09-28 16:20:55 +00:00
return form($form);
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
2001-05-28 18:53:48 +00:00
function import_save_bundle($edit) {
2001-12-30 16:16:38 +00:00
if ($edit["bid"] && $edit["title"]) {
2002-04-20 11:52:50 +00:00
db_query("UPDATE bundle SET title = '%s', attributes = '%s' WHERE bid = '%s'", $edit["title"], $edit["attributes"], $edit["bid"]);
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
2001-12-30 16:16:38 +00:00
else if ($edit["bid"]) {
2002-04-20 11:52:50 +00:00
db_query("DELETE FROM bundle WHERE bid = '%s'", $edit["bid"]);
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
2001-12-30 16:16:38 +00:00
else if ($edit["title"]) {
2002-10-26 15:17:26 +00:00
// a single unique id for bundles and feeds, to use in blocks
$next_id = db_next_id("import");
db_query("INSERT INTO bundle (bid, title, attributes) VALUES ('%d', '%s', '%s')", $next_id, $edit["title"], $edit["attributes"]);
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
}
2001-05-28 18:53:48 +00:00
function import_form_feed($edit = array()) {
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
$period = array(900 => format_interval(900), 1800 => format_interval(1800), 3600 => format_interval(3600), 7200 => format_interval(7200), 10800 => format_interval(10800), 21600 => format_interval(21600), 32400 => format_interval(32400), 43200 => format_interval(43200), 64800 => format_interval(64800), 86400 => format_interval(86400), 172800 => format_interval(172800), 259200 => format_interval(259200), 604800 => format_interval(604800), 1209600 => format_interval(1209600), 2419200 => format_interval(2419200));
2001-12-30 16:16:38 +00:00
if ($edit["refresh"] == "") {
$edit["refresh"] = 3600;
}
2001-07-11 22:06:24 +00:00
2001-12-30 16:16:38 +00:00
$form .= form_textfield("Title", "title", $edit["title"], 50, 64, "The name of the feed; typically the name of the website you syndicate content from.");
$form .= form_textfield("Url", "url", $edit["url"], 50, 128, "The fully-qualified URL of the feed.");
$form .= form_textfield("Attributes", "attributes", $edit["attributes"], 50, 128, "A comma-seperated list of keywords describing the feed.");
$form .= form_select("Update interval", "refresh", $edit["refresh"], $period, "The refresh interval indicating how often you want to update this feed. Requires crontab.");
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
$form .= form_submit("Submit");
2001-12-30 16:16:38 +00:00
if ($edit["fid"]) {
2001-09-24 18:46:07 +00:00
$form .= form_submit("Delete");
2001-12-30 16:16:38 +00:00
$form .= form_hidden("fid", $edit["fid"]);
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
2001-09-28 16:20:55 +00:00
return form($form);
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
2001-05-28 18:53:48 +00:00
function import_save_feed($edit) {
2001-12-30 16:16:38 +00:00
if ($edit["fid"] && $edit["title"]) {
2002-04-20 11:52:50 +00:00
db_query("UPDATE feed SET title = '%s', url = '%s', attributes = '%s', refresh = '%s' WHERE fid = '%s'", $edit["title"], $edit["url"], $edit["attributes"], $edit["refresh"], $edit["fid"]);
db_query("DELETE FROM item WHERE fid = '%s'", $edit["fid"]);
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
2001-12-30 16:16:38 +00:00
else if ($edit["fid"]) {
2002-04-20 11:52:50 +00:00
db_query("DELETE FROM feed WHERE fid = '%s'", $edit["fid"]);
db_query("DELETE FROM item WHERE fid = '%s'", $edit["fid"]);
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
2001-12-30 16:16:38 +00:00
else if ($edit["title"]) {
2002-10-26 15:17:26 +00:00
// a single unique id for bundles and feeds, to use in blocks
$next_id = db_next_id("import");
db_query("INSERT INTO feed (fid, title, url, attributes, refresh) VALUES ('%d', '%s', '%s', '%s', '%s')", $next_id, $edit["title"], $edit["url"], $edit["attributes"], $edit["refresh"]);
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
}
2001-05-28 18:53:48 +00:00
function import_save_attributes($edit) {
2001-12-30 16:16:38 +00:00
foreach ($edit as $iid => $value) {
2002-04-20 11:52:50 +00:00
db_query("UPDATE item SET attributes = '%s' WHERE iid = '%s'", $value, $iid);
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
return "attributes has been saved";
}
2001-05-28 18:53:48 +00:00
function import_get_feed($fid) {
2002-04-20 11:52:50 +00:00
return db_fetch_array(db_query("SELECT * FROM feed WHERE fid = '%s'", $fid));
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
2001-05-28 18:53:48 +00:00
function import_get_bundle($bid) {
2002-04-20 11:52:50 +00:00
return db_fetch_array(db_query("SELECT * FROM bundle WHERE bid = '%s'", $bid));
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
2001-07-09 18:13:53 +00:00
function import_view() {
2001-12-24 10:51:25 +00:00
$result = db_query("SELECT f.*, COUNT(i.iid) AS items FROM feed f LEFT JOIN item i ON f.fid = i.fid GROUP BY f.fid, f.title, f.url, f.refresh, f.timestamp, f.attributes, f.link, f.description ORDER BY f.title");
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
2001-07-07 13:07:03 +00:00
$output .= "<h3>Feed overview</h3>";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
2001-07-11 22:06:24 +00:00
$output .= " <tr><th>title</th><th>attributes</th><th>items</th><th>last update</th><th>next update</th><th colspan=\"3\">operations</th></tr>\n";
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
while ($feed = db_fetch_object($result)) {
2002-04-22 09:05:36 +00:00
$output .= " <tr><td>". check_output($feed->title) ."</td><td>". check_output($feed->attributes) ."</td><td>". format_plural($feed->items, "item", "items") ."</td><td>". ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never") ."</td><td>". ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never") ."</td><td>". la(t("edit feed"), array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $feed->fid)) ."</td><td>". la(t("remove items"), array("mod" => "import", "type" => "feed", "op" => "remove", "id" => $feed->fid)) ."</td><td>". la(t("update items"), array("mod" => "import", "type" => "feed", "op" => "update", "id" => $feed->fid)) ."</td></tr>\n";
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
2001-07-07 13:07:03 +00:00
$output .= "</table>\n";
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
$result = db_query("SELECT * FROM bundle ORDER BY title");
2001-07-07 13:07:03 +00:00
$output .= "<h3>Bundle overview</h3>";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
$output .= " <tr><th>title</th><th>attributes</th><th>operations</th></tr>\n";
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
while ($bundle = db_fetch_object($result)) {
2002-04-22 09:05:36 +00:00
$output .= " <tr><td>". check_output($bundle->title) ."</td><td>". check_output($bundle->attributes) ."</td><td>". la(t("edit bundle"), array("mod" => "import", "type" => "bundle", "op" => "edit", "id" => $bundle->bid)) ."</td></tr>\n";
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
2001-07-07 13:07:03 +00:00
$output .= "</table>\n";
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
return $output;
}
2001-08-04 13:37:41 +00:00
function import_fd_form() {
2001-08-04 14:09:05 +00:00
$form .= form_textfield("Feed directory file", "url", "http://", 64, 128, "The fully-qualified URL of the feed directory file.");
2001-08-04 13:37:41 +00:00
$form .= form_submit("Collect feeds");
2001-09-28 16:20:55 +00:00
return form($form);
2001-08-04 13:37:41 +00:00
}
function import_fd_collect($edit) {
set_time_limit(180);
2001-12-30 16:16:38 +00:00
if ($fp = @fopen($edit["url"], "r")) {
2001-08-04 13:37:41 +00:00
// fetch data:
while (!feof($fp)) {
$data .= fgets($fp, 128);
}
2001-08-05 10:21:32 +00:00
fclose($fp);
2001-08-04 13:37:41 +00:00
// initialize the translation table:
$tt = array_flip(get_html_translation_table(HTML_ENTITIES));
$tt["'"] = "'";
$items = explode("</channel>", $data);
foreach ($items as $item) {
2001-12-30 16:16:38 +00:00
unset($link, $title);
2001-08-04 13:37:41 +00:00
// print "<pre>item = ". htmlentities($item) ."\n\n</pre>";
eregi("<link>(.*)</link>", $item, $link);
eregi("<title>(.*)</title>", $item, $title);
$link = strip_tags(strtr($link[1], $tt));
$title = strip_tags(strtr($title[1], $tt));
// print "<b>title = $title, link = $link<br /></b>";
2002-04-20 11:52:50 +00:00
if ($link && $link && !db_fetch_array(db_query("SELECT * FROM feed WHERE url = '%s'", $link))) {
2001-08-04 13:37:41 +00:00
$output .= "<input type=\"checkbox\" name=\"edit[$title]\" value=\"$link\"> ". strtr($title, $tt) ."<br />";
}
}
$output .= "<input type=\"submit\" name=\"op\" value=\"Import feeds\" />\n";
2001-09-28 16:20:55 +00:00
return form($output);
2001-08-04 13:37:41 +00:00
}
else {
2001-12-30 16:16:38 +00:00
print status("failed to open '". $edit["url"] ."': $errstr.");
2001-07-11 22:06:24 +00:00
}
}
2001-08-04 13:37:41 +00:00
function import_fd_import($edit) {
2001-08-04 14:09:05 +00:00
if ($edit) {
foreach ($edit as $title => $link) {
2001-12-24 10:51:25 +00:00
import_save_feed(array("title" => $title, "url" => $link, "refresh" => 3600));
2001-08-04 14:09:05 +00:00
}
2001-07-11 22:06:24 +00:00
}
}
2001-08-04 13:37:41 +00:00
function import_tag() {
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
2001-07-15 17:05:32 +00:00
$result = db_query("SELECT i.*, f.title AS feed FROM item i LEFT JOIN feed f ON i.fid = f.fid ORDER BY i.iid DESC LIMIT 50");
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
2001-07-07 13:07:03 +00:00
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
$output .= " <tr><th>time</th><th>feed</th><th>item</th></tr>\n";
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
while ($item = db_fetch_object($result)) {
2002-04-22 09:05:36 +00:00
$output .= " <tr><td valign=\"top\" nowrap=\"nowrap\">". format_date($item->timestamp, "custom", "m/d/y") ."<br />". format_date($item->timestamp, "custom", "H:i") ."</td><td align=\"center\" valign=\"top\" nowrap=\"nowrap\">". la(check_output($item->feed), array("mod" => "import", "type" => "feed", "op" => "edit", "id" => $item->fid)) ."</td><td><a href=\"". check_output($item->link) ."\">". check_output($item->title) ."</a>". ($item->description ? "<br /><small><i>". check_output($item->description, 1) ."</i></small>" : "") ."<br /><input type=\"text\" name=\"edit[$item->iid]\" value=\"". check_form($item->attributes) ."\" size=\"50\" /></td></tr>\n";
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
2001-07-07 13:07:03 +00:00
$output .= "</table>\n";
$output .= "<input type=\"submit\" name=\"op\" value=\"Save attributes\" />\n";
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
2001-09-28 16:20:55 +00:00
return form($output);
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
2001-05-28 18:53:48 +00:00
function import_admin() {
2001-06-29 22:08:57 +00:00
global $op, $id, $type, $edit;
2001-06-20 20:00:40 +00:00
2001-07-11 22:06:24 +00:00
if (user_access("administer news feeds")) {
2001-06-20 20:00:40 +00:00
2002-04-20 11:52:50 +00:00
$links[] = la(t("add new feed"), array("mod" => "import", "type" => "feed", "op" => "add"));
$links[] = la(t("add new bundle"), array("mod" => "import", "type" => "bundle", "op" => "add"));
$links[] = la(t("import feeds"), array("mod" => "import", "op" => "fd"));
$links[] = la(t("tag items"), array("mod" => "import", "op" => "tag"));
$links[] = la(t("overview"), array("mod" => "import", "op" => "view"));
$links[] = la(t("help"), array("mod" => "import", "op" => "help"));
2002-04-22 09:05:36 +00:00
print "<small>". implode(" | ", $links) ."</small><hr />";
2001-06-20 20:00:40 +00:00
2001-12-30 16:16:38 +00:00
switch ($op) {
2001-06-20 20:00:40 +00:00
case "help":
print import_help();
break;
case "add":
2001-12-30 16:16:38 +00:00
if ($type == "bundle") {
2001-06-20 20:00:40 +00:00
print import_form_bundle();
2001-12-30 16:16:38 +00:00
}
else {
2001-06-20 20:00:40 +00:00
print import_form_feed();
2001-12-30 16:16:38 +00:00
}
2001-06-20 20:00:40 +00:00
break;
case "edit":
2001-12-30 16:16:38 +00:00
if ($type == "bundle") {
2001-06-20 20:00:40 +00:00
print import_form_bundle(import_get_bundle($id));
2001-12-30 16:16:38 +00:00
}
else {
2001-06-20 20:00:40 +00:00
print import_form_feed(import_get_feed($id));
2001-12-30 16:16:38 +00:00
}
2001-06-20 20:00:40 +00:00
break;
2001-08-04 13:37:41 +00:00
case "fd":
print import_fd_form();
break;
case "Collect feeds":
print import_fd_collect($edit);
break;
case "Import feeds":
print import_fd_import($edit);
print import_view();
break;
2001-06-20 20:00:40 +00:00
case "remove":
print status(import_remove(import_get_feed($id)));
2001-07-11 22:06:24 +00:00
print import_view();
2001-06-20 20:00:40 +00:00
break;
case "update":
2001-07-11 22:06:24 +00:00
print status(import_refresh(import_get_feed($id)));
print import_view();
2001-06-20 20:00:40 +00:00
break;
2001-08-04 13:37:41 +00:00
case "tag":
print import_tag();
break;
2001-06-20 20:00:40 +00:00
case "Save attributes":
print status(import_save_attributes($edit));
2001-08-04 13:37:41 +00:00
print import_tag();
2001-06-20 20:00:40 +00:00
break;
case "Delete":
2001-12-30 16:16:38 +00:00
$edit["title"] = 0;
2001-06-20 20:00:40 +00:00
// fall through:
case "Submit":
2001-12-30 16:16:38 +00:00
if ($type == "bundle") {
2001-06-20 20:00:40 +00:00
print status(import_save_bundle($edit));
2001-12-30 16:16:38 +00:00
}
else {
2001-06-20 20:00:40 +00:00
print status(import_save_feed($edit));
2001-12-30 16:16:38 +00:00
}
2001-06-20 20:00:40 +00:00
// fall through:
default:
2001-08-04 13:37:41 +00:00
print import_view();
2001-06-20 20:00:40 +00:00
}
}
else {
print message_access();
- Rewrote the headline module from scratch. Note that the old
headline code is still in place 'till the new code has proven
to be stable. See "syndication.module" for the new code.
Changes:
+ Improved the parser and tested it against RSS 0.9, RSS 0.91,
RSS 0.92, RSS 1.0, RDF and XML feeds.
+ Improved the administration interface. It might be a bit fuzzy
at first. Maybe some native English like Julian, Michael (or any
one else with knowledge in the field) can help out by suggesting
better naming, terminology or descriptions - as well as by
writing the help section for this module? I'd have no idea how
much this would be appreciated.
+ We can *easily* recognize new tags or extensions: we parse out
"link", "title", "description" and "author" right now, but we
will have to revise which tags to support and which not. New
tags can be added in less than 10 minutes (if you are familiar
with the code). Read: we have something we can build on.
+ Within each item, tags can now appear is random order which is
or was not the case with the old headline code where we expect
<link>s prior to <description>s for example.
+ Feed updates only (ie. always) happen through cron. Neither do
we use one global cron for updating all feeds; instead, every
feed can specify his own update-interval.
+ Newly fetched headlines are "appended" to the pool of existing
headlines (read: we don't replace the whole feed), and headlines
automatically "expire" after x days or hours. (Every headline
has a timestamp.)
+ Got rid of backend.class; it is integrated in the module.
+ Switched to more generic names: "headline" became "item" and
"backend" became "feed". This should ease future non-headline
oriented syndication.
+ You can associate attributes or keyword lists with every feed.
At the moment new items will automatically inherit their feeds
attributes but in future we can use heuristics to make these
attributes "mutate" when and where we see fit. The attributes
can be maintained by hand as well.
+ We don't export any blocks yet; we will soon do as soon this
new code has been tested for a bit more. We will only export
bundles though so if you want to export by feed/source, you
will have to make a source-specific bundle.
- Polished a bit on a few other modules: nothing major.
2001-05-26 18:26:56 +00:00
}
}
2001-07-15 11:32:46 +00:00
function import_page_info() {
global $theme;
2002-05-12 15:40:57 +00:00
$links[] = lm(t("latest news"), array("mod" => "import"), "", array("title" => t("Read the latest news from syndicated websites.")));
$links[] = lm(t("news by source"), array("mod" => "import", "op" => "feeds"), "", array("title" => t("View the latest headlines sorted by source.")));
$links[] = lm(t("news by topic"), array("mod" => "import", "op" => "bundles"), "", array("title" => t("View the latest headlines sorted by topic.")));
$links[] = lm(t("news sources"), array("mod" => "import", "op" => "sources"), "", array("title" => t("View a list of all the websites we syndicate from.")));
2002-06-10 19:49:16 +00:00
if (user_access("administer news feeds")) {
$links[] = la(t("administer news feeds"), array("mod" => "import"), "", array("title" => t("View the news feed administrative pages.")));
}
2001-07-15 11:32:46 +00:00
return "<div align=\"center\">". $theme->links($links) ."</div>";
}
2001-07-14 19:02:36 +00:00
function import_page_last() {
2001-07-11 22:06:24 +00:00
global $theme;
$result = db_query("SELECT i.*, f.title AS ftitle, f.link AS flink FROM item i LEFT JOIN feed f ON i.fid = f.fid ORDER BY i.iid DESC LIMIT ". variable_get("import_page_limit", 75));
2001-07-14 19:02:36 +00:00
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
2001-07-11 22:06:24 +00:00
while ($item = db_fetch_object($result)) {
2002-12-10 20:35:20 +00:00
if (module_exist("blog") && user_access("maintain personal blog")) {
2002-06-10 19:49:16 +00:00
$links[] = lm(t("blog it"), array("mod" => "node", "op" => "add", "type" => "blog", "iid" => $item->iid), "", array("title" => t("Comment on this news item in your personal blog.")));
}
2002-05-12 15:40:57 +00:00
$links[] = lm(t("feed"), array("mod" => "import", "op" => "feed", "id" => $item->fid), "", array("title" => t("Read more syndicated news from this feed.")));
2001-07-14 19:02:36 +00:00
if ($item->link) {
2002-05-12 15:40:57 +00:00
$output .= "<tr><td><a href=\"$item->link\">$item->title</a> · ". lm($item->ftitle, array("mod" => "import", "op" => "feed", "id" => $item->fid), "", array("title" => t("View more information about this feed."))) ."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n";
2001-07-14 19:02:36 +00:00
}
2002-01-07 22:08:52 +00:00
2001-07-14 19:02:36 +00:00
if ($item->description) {
2001-08-15 12:30:26 +00:00
$output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">". check_output($item->description, 1) ."</div><br /></td></tr>";
2001-07-14 19:02:36 +00:00
}
unset($links);
2001-07-11 22:06:24 +00:00
}
2001-07-14 19:02:36 +00:00
$output .= "</table>\n";
2001-07-11 22:06:24 +00:00
$theme->header();
2001-07-15 11:32:46 +00:00
$theme->box(t("News feeds"), import_page_info());
2001-07-14 00:05:30 +00:00
$theme->box(t("Latest news"), $output);
2001-07-11 22:06:24 +00:00
$theme->footer();
}
function import_page_feed($fid) {
global $theme;
2002-04-20 11:52:50 +00:00
$feed = db_fetch_object(db_query("SELECT * FROM feed WHERE fid = '%s'", $fid));
2001-07-11 22:06:24 +00:00
2002-05-12 15:40:57 +00:00
$header .= "<p><b>". t("Website") .":</b><div style=\"margin-left: 20px;\"><a href=\"$feed->link\">$feed->link</a></div></p>";
2001-08-15 12:30:26 +00:00
$header .= "<p><b>". t("Description") .":</b><div style=\"margin-left: 20px;\">". check_output($feed->description, 1) ."</div></p>";
2001-08-04 13:37:41 +00:00
$header .= "<p><b>". t("Last update") .":</b><div style=\"margin-left: 20px;\">". format_interval(time() - $feed->timestamp) ." ". t("ago") ."<a href=\"$feed->url\"><img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" /></a><br /><br /></div></p>\n";
2001-07-11 22:06:24 +00:00
2002-04-20 11:52:50 +00:00
$result = db_query("SELECT * FROM item WHERE fid = '%s' ORDER BY iid DESC LIMIT ". variable_get("import_page_limit", 75), $fid);
2001-07-14 19:02:36 +00:00
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
2001-07-11 22:06:24 +00:00
while ($item = db_fetch_object($result)) {
2002-12-10 20:35:20 +00:00
if (module_exist("blog") && user_access("maintain personal blog")) {
2002-09-14 13:51:57 +00:00
$links[] = lm(t("blog it"), array("mod" => "node", "op" => "add", "type" => "blog", "iid" => $item->iid), "", array("title" => t("Comment on this news item in your personal blog.")));
}
2001-07-14 19:02:36 +00:00
$links[] = "<a href=\"$item->link\">". t("visit") ."</a>";
2001-07-11 22:06:24 +00:00
2001-07-14 19:02:36 +00:00
if ($item->link) {
2002-05-12 15:40:57 +00:00
$output .= "<tr><td><a href=\"$item->link\">$item->title</a></td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n";
2001-07-14 19:02:36 +00:00
}
if ($item->description) {
2001-08-15 12:30:26 +00:00
$output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">". check_output($item->description, 1) ."</div><br /></td></tr>";
2001-07-14 19:02:36 +00:00
}
unset($links);
}
$output .= "</table>\n";
2001-07-11 22:06:24 +00:00
$theme->header();
2002-06-12 12:25:49 +00:00
$theme->box(t("News feeds"), import_page_info());
2001-07-14 19:02:36 +00:00
$theme->box(check_output($feed->title), $header);
$theme->box(t("Latest news"), $output);
2001-07-11 22:06:24 +00:00
$theme->footer();
}
function import_page_bundle($bid) {
global $theme;
2002-04-20 11:52:50 +00:00
$bundle = db_fetch_object(db_query("SELECT * FROM bundle WHERE bid = '%s'", $bid));
2001-07-14 19:02:36 +00:00
2002-06-12 12:25:49 +00:00
$header .= "<p><b>". t("Website") .":</b><div style=\"margin-left: 20px;\">". lm($bundle->title, array("mod" => "import", "op" => "bundle", "id" => $bundle->bid)) ."</div></p>";
2001-07-14 19:02:36 +00:00
$header .= "<p><b>". t("Description") .":</b><div style=\"margin-left: 20px;\">". t("A composite news feed about") ." ". check_output($bundle->attributes) .".</div></p>";
2001-07-11 22:06:24 +00:00
$keys = explode(",", $bundle->attributes);
foreach ($keys as $key) $where[] = "i.attributes LIKE '%". trim($key) ."%'";
$result = db_query("SELECT i.*, f.title AS ftitle, f.link AS flink FROM item i, feed f WHERE (". implode(" OR ", $where) .") AND i.fid = f.fid ORDER BY iid DESC LIMIT ". variable_get("import_page_limit", 75));
2001-07-14 19:02:36 +00:00
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
2001-07-11 22:06:24 +00:00
while ($item = db_fetch_object($result)) {
2002-12-10 20:35:20 +00:00
if (module_exist("blog") && user_access("maintain personal blog")) {
2002-09-14 13:51:57 +00:00
$links[] = lm(t("blog it"), array("mod" => "node", "op" => "add", "type" => "blog", "iid" => $item->iid), "", array("title" => t("Comment on this news item in your personal blog.")));
}
2002-05-12 15:40:57 +00:00
$links[] = lm(t("feed"), array("mod" => "import", "op" => "feed", "id" => $item->fid), "", array("title" => t("Read more syndicated news from this feed.")));
2001-07-14 19:02:36 +00:00
$links[] = "<a href=\"$item->link\">". t("visit") ."</a>";
if ($item->link) {
2002-05-12 15:40:57 +00:00
$output .= "<tr><td><a href=\"$item->link\">$item->title</a> · ". lm($item->ftitle, array("mod" => "import", "op" => "feed", "id" => $item->fid), "", array("title" => t("View more information about this feed."))) ."</td><td align=\"right\" nowrap=\"nowrap\" valign=\"top\">". $theme->links($links) ."</td></tr>\n";
2001-07-14 19:02:36 +00:00
}
2002-01-07 22:08:52 +00:00
2001-07-14 19:02:36 +00:00
if ($item->description) {
2001-08-15 12:30:26 +00:00
$output .= "<tr><td colspan=\"2\"><div style=\"margin-left: 20px;\">". check_output($item->description, 1) ."</div><br /></td></tr>";
2001-07-14 19:02:36 +00:00
}
unset($links);
2001-07-11 22:06:24 +00:00
}
2001-07-14 19:02:36 +00:00
$output .= "</table>\n";
2001-07-11 22:06:24 +00:00
$theme->header();
2002-06-12 12:25:49 +00:00
$theme->box(t("News feeds"), import_page_info());
2001-07-14 19:02:36 +00:00
$theme->box(check_output($bundle->title), $header);
$theme->box(t("Latest news"), $output);
2001-07-11 22:06:24 +00:00
$theme->footer();
2001-07-14 19:02:36 +00:00
2001-07-11 22:06:24 +00:00
}
2001-07-15 11:32:46 +00:00
function import_page_sources() {
global $theme;
$result = db_query("SELECT * FROM feed ORDER BY title");
while ($feed = db_fetch_object($result)) {
2002-06-12 12:25:49 +00:00
$output .= lm($feed->title, array("mod" => "import", "op" => "feed", "id" => $feed->fid));
2001-09-16 11:33:14 +00:00
$output .= "<div style=\"margin-left: 20px;\">". check_output($feed->description, 1) ."</div><br />";
2001-07-15 11:32:46 +00:00
}
2002-05-12 15:40:57 +00:00
$output .= lm("<img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", array("mod" => "import", "op" => "fd"), "", array("title" => t("View the list of syndicated websites in XML format."))) ."<br />\n";
2001-08-04 13:37:41 +00:00
2001-07-15 11:32:46 +00:00
$theme->header();
$theme->box(t("News feeds"), import_page_info());
$theme->box(t("News sources"), $output);
$theme->footer();
}
2001-08-04 13:37:41 +00:00
function import_page_fd() {
$result = db_query("SELECT * FROM feed ORDER BY title");
$output .= "<?xml version=\"1.0\"?>\n\n";
2001-08-05 08:43:58 +00:00
$output .= "<rssfeeds version=\"0.1\">\n\n";
2001-08-04 13:37:41 +00:00
while ($feed = db_fetch_object($result)) {
$output .= "<channel>\n";
$output .= " <title>". htmlentities($feed->title) ."</title>\n";
$output .= " <link>". htmlentities($feed->url) ."</link>\n";
$output .= "</channel>\n\n";
}
2001-08-05 08:43:58 +00:00
$output .= "</rssfeeds>\n";
2001-08-14 06:52:50 +00:00
header("Content-Type: text/xml");
2001-08-04 13:37:41 +00:00
print $output;
}
2001-07-11 22:06:24 +00:00
function import_page_bundles() {
2001-07-12 16:50:12 +00:00
import_page_blocks(import_get_bundles());
2001-07-11 22:06:24 +00:00
}
function import_page_feeds() {
2001-07-12 16:50:12 +00:00
import_page_blocks(import_get_feeds());
2001-07-11 22:06:24 +00:00
}
function import_page_blocks($blocks) {
global $theme;
$theme->header();
2001-07-15 11:32:46 +00:00
$theme->box(t("News feeds"), import_page_info());
2001-07-11 22:06:24 +00:00
print "<table cellpadding=\"0\" cellspacing=\"5\" border=\"0\" width=\"100%\">\n";
print " <tr>\n";
2002-10-26 15:17:26 +00:00
for ($t = 0; $t < 3; $t++) {
$i = 1;
print " <td width=\"33%\" valign=\"top\">\n";
while ($block = each($blocks)) {
$theme->box($block["value"]["subject"], $block["value"]["content"]);
if ($i == ceil(count($blocks) / 3)) {
break;
}
$i++;
}
print " </td>\n";
}
2001-07-11 22:06:24 +00:00
print " </tr>\n";
print "</table>\n";
$theme->footer();
}
function import_page() {
global $op, $id;
if (user_access("access news feeds")) {
2001-12-30 16:16:38 +00:00
switch ($op) {
2001-07-11 22:06:24 +00:00
case "feed":
import_page_feed($id);
break;
case "bundle":
import_page_bundle($id);
break;
2001-07-15 11:32:46 +00:00
case "feeds":
import_page_feeds();
break;
2001-07-11 22:06:24 +00:00
case "bundles":
import_page_bundles();
break;
2001-07-15 11:32:46 +00:00
case "sources":
import_page_sources();
2001-07-11 22:06:24 +00:00
break;
2001-08-04 13:37:41 +00:00
case "fd":
import_page_fd();
break;
2001-07-11 22:06:24 +00:00
default:
2001-07-14 19:02:36 +00:00
import_page_last();
2001-07-11 22:06:24 +00:00
}
}
}
2001-11-01 11:00:51 +00:00
2002-10-26 15:17:26 +00:00
?>