Samizdat - Patches: patch #5881, import_feeds version 0.7.1 [vs...
You are not allowed to post comments on this tracker with your current authentication level.
patch #5881: import_feeds version 0.7.1 [vs 080811-1] new i18n version
Submitter: | Dmitry Borodaenko <angdraug> | ||
Submitted: | Sun 22 Apr 2007 05:57:56 PM UTC | ||
Category: | None | Priority: | 5 - Normal |
Status: | Wont Do | Privacy: | Public |
Assigned to: | None | Open/Closed: | Open |
( Jump to the original submission )
Thu 09 Apr 2009 11:47:44 AM UTC, comment #12: |
Dmitry Borodaenko <angdraug>![]() |
Mon 06 Apr 2009 05:39:43 PM UTC, comment #11: After some consideration, I'm leaning towards a Solomon's solution to the feed import i18n issue: don't send Accept-Language header at all.
RSS feeds that support HTTP language negotiation are far and wide between, and they all have to deal with the reality that most RSS readers don't do language negotiation, so in absense of Accept-Language header all such feeds are expected to provide sensible default (in case of Samizdat, that would be default_language of the site serving the feed).
Language-conscious admins will still be able to specify language in the feed's URL. To support that approach in Samizdat feeds, I am going to merge patch #6171. |
Dmitry Borodaenko <angdraug>![]() |
Fri 29 Aug 2008 11:42:52 PM UTC, comment #10: version 0.7.1 avoids an error which occurred in 0.7 if 'import_feeds' was not configured at all for a samizdat site. The difference is:
|
Boud Roukema <boud>![]() |
Sat 19 Jul 2008 05:06:03 PM UTC, comment #9: import_feeds-0.7 vs 080703-2
This is an update of the i18n issue first commented below:
WARNING: The patch requires updating of the 'import_feeds' section of
FEEDS_LANGUAGES: The list of languages in which to try to import
There are two reasons for this:
to be imported in that language even though readers rarely choose
then all these languages will be used during feed imports - e.g.
LANGUAGE IN URL:
EXCEPTIONS ON FAILED FEEDS:
|
Boud Roukema <boud>![]() |
Sat 03 May 2008 01:03:59 AM UTC, comment #8: What i just uploaded as the patch import_feeds version 0.6
|
Boud Roukema <boud>![]() |
Sat 03 May 2008 12:17:21 AM UTC, comment #7: So now i don't know if i should post further corrections here
Anyway, here's an updated patch against 070818.
The new thing is in samizdat-import-feeds to take into
When the samizdat-import-feeds script is going through the
Possible TODO: Some sites might give multiple language mixed up in a single feed and label the individual items with language tags. i haven't seen this in practice so far. What i have seen would require more fuzzy intelligence: a mixed language feed which would require a heuristic for guessing the language by content analysis - but this should probably not be a high priority.
|
Boud Roukema <boud>![]() |
Sat 23 Feb 2008 01:45:32 AM UTC, comment #6: Same problem as with patch #5882: you should've raised a bug instead of re-opening the patch.
I will include the nil bug fix in the next snapshot, the i18n issue is not so trivial so it will not be fixed until after 0.6.1. |
Dmitry Borodaenko <angdraug>![]() |
Sun 26 Aug 2007 11:23:41 PM UTC, comment #5: i18n is missing from the 070818-1 version, so i'm switching from Done to Works For Me status.
|
Boud Roukema <boud>![]() |
Mon 20 Aug 2007 09:56:33 PM UTC, comment #4: This patch corrects a minor bug and adds i18n functionality to
http://lists.gnu.org/archive/html/samizdat-devel/2007-08/msg00005.html
MINOR BUG:
If url == nil due to an error in the config, then this crashes
I18N FUNCTIONALITY:
People clicking on the frontpage having different preferred
So should samizdat-import-helper download RDF feeds for all
So the solution proposed here is to keep a persistent_cache
The effect to a user with a non-default preferred language
TODO: i couldn't find out how to make varying cache time
The patch is attached below.
|
Boud Roukema <boud>![]() |
Sat 18 Aug 2007 06:08:46 PM UTC, comment #3: Refactored and integrated in snapshot 2007-08-18.
Differences from Boud's version:
RSS import is configured pretty much the same as in Boud's patch, but it works quite differently: feeds are fetched and parsed by an
|
Dmitry Borodaenko <angdraug>![]() |
Sun 08 Jul 2007 02:24:35 PM UTC, comment #2: Version 0.4 fails to catch a timeout error on at least one
This patch 0.4.1 is a patch relative to 0.4. (It's simple enough
The patch is here and below as a file: it uses the
TODO: The timeout of 10 seconds is hardwired and should
--- old/samizdat/helpers/import_feeds_helper.rb~ 2007-05-18 16:23:44.000000000 -0500
# TODO: The format_date method is from template.rb. In principle,
|
Boud Roukema <boud>![]() |
Tue 08 May 2007 10:23:22 PM UTC, comment #1: version 0.4 works for samizdat-0.6.0.20070506 - attached as a file
|
Boud Roukema <boud>![]() |
Sun 22 Apr 2007 05:57:56 PM UTC, original submission:
http://lists.nongnu.org/archive/html/samizdat-devel/2006-10/msg00004.html
(1) index.rb patch
--- /tmp/samizdat_snapshot060924/cgi-bin/index.rb 2006-09-22
require 'samizdat/engine'
+require 'import_feeds.rb' # TODO - should this be load or require?
+ imported_feeds = "" # default is zero-length string
(2) /usr/share/samizdat/cgi-bin/import_feeds.rb
#!/usr/bin/env ruby
require 'samizdat/engine'
require 'open-uri'
# TODO: The format_date method is from template.rb. In principle,
def import_feeds_method()
import_feeds_body = "<ul>"
interval = config['timeout']['import_feeds'] # time interval for importing
# The expected caching time is the last "round number" time interval,
import_feeds_list_array = cache[import_feeds_cache_key]
if(import_feeds_list_array == nil)
import_feeds_list = Hash.new
config['import_feeds'].each do | feed_key, feed_value |
# At some point in the future, people might want to have e.g. https
protocol = feed_value['protocol']
host = feed_value['host']
# TODO: security - check before untainting?
if(valid_URI==1)
# The parsing of the feed initially allows non-RSS-1.0 compliant
if(rss)
# if there is a 'max_entries' parameter, then use at most that
for item_number in 0...n_items
# add this feed to the list of valid feeds
end
# Sort the import feeds list by date. The result is an array of
# update the cache
end # if(import_feeds_list_array == nil)
import_feeds_list_array.each do | feed |
import_feeds_body += "</ul>"
import_feeds_body
end # def import_feeds_method
(3a) Add to config.yaml
# RDF/RSS Feeds
# The default installation will include this sorted list in # the lefthand column of the front page of your samizdat installation.
# Example entry (simple) to import: http://myfriend.site.org/friend/feed
(3b) Add caching timeout to timeout section of defaults.yaml
timeout: # example value only, 3600 seconds
|
Dmitry Borodaenko <angdraug>![]() |
Depends on the following items: None found
Items that depend on this one: None found
Follow 17 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2009-04-06 | angdraug | Status | Postponed | ![]() |
Wont Do |
2008-08-29 | boud | Attached File | - | ![]() |
Added 080830_import_feeds-0.7.1.patch, #16392 |
Summary | import_feeds version 0.7 [vs 080703-2] new i18n version | ![]() |
import_feeds version 0.7.1 [vs 080811-1] new i18n version | ||
2008-07-19 | boud | Attached File | - | ![]() |
Added 080719_import_feeds-0.7.patch, #16159 |
Summary | import_feeds version 0.6 (for importing RDF etc. feeds) vs 070818 | ![]() |
import_feeds version 0.7 [vs 080703-2] new i18n version | ||
2008-05-03 | boud | Attached File | - | ![]() |
Added 080502_import_feeds-0.6-patch, #15593 |
Summary | import_feeds version 0.5 (for importing RDF etc. feeds) vs 070818 | ![]() |
import_feeds version 0.6 (for importing RDF etc. feeds) vs 070818 | ||
2008-02-23 | angdraug | Priority | 7 - High | ![]() |
5 - Normal |
Status | Works For Me | ![]() |
Postponed | ||
2007-08-26 | boud | Status | Done | ![]() |
Works For Me |
2007-08-20 | boud | Attached File | - | ![]() |
Added 070820_import_feeds-0.5-patch, #13743 |
Summary | import_feeds.rb version 0.4.1 (for importing RDF etc. feeds) | ![]() |
import_feeds version 0.5 (for importing RDF etc. feeds) vs 070818 | ||
2007-08-18 | angdraug | Status | In Progress | ![]() |
Done |
2007-07-08 | boud | Attached File | - | ![]() |
Added 070707_import_feeds-0.4.1-patch, #13269 |
Summary | import_feeds.rb version 0.4 (for importing RDF etc. feeds) | ![]() |
import_feeds.rb version 0.4.1 (for importing RDF etc. feeds) | ||
2007-05-08 | boud | Attached File | - | ![]() |
Added imp, #12721 |
Summary | import_feeds.rb version 0.2 (for importing RDF etc. feeds) | ![]() |
import_feeds.rb version 0.4 (for importing RDF etc. feeds) |
Accept-Language removed from RSS import as of 0.6.2.20090409-1.