• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

Cleaner web feed aggregation with App::FeedDeduplicator

Lomanu4 Оффлайн

Lomanu4

Команда форума
Администратор
Регистрация
1 Мар 2015
Сообщения
1,481
Баллы
155
I write blog posts in a number of different places:


And most of those posts get syndicated to other places:


It’s also possible that I’ll write original posts on one of these syndication sites without posting to one of my sites first.

Recently, when revamping my

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

I decided that I wanted to display a list recent posts from all of those sources. But because of the syndication, it was all a bit noisy: multiple copies of the same post, repeated titles, and a poor reading experience.

What I wanted was a single, clean feed — a unified view of everything I’ve written, without repetition.

So I wrote a tool.

The Problem


I wanted to:

  • Aggregate several feeds into one
  • Remove syndicated duplicates automatically
  • Prefer the canonical/original version of each post
  • Output the result in Atom (or optionally RSS or JSON)
The Solution: App::FeedDeduplicator



Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

is a new CPAN module and CLI tool for aggregating and deduplicating web feeds.

It reads a list of feed URLs from a JSON config file, downloads and parses them, filters out duplicates (based on canonical URLs or titles), sorts the results by date, and emits a clean, modern feed.

How It Works

  1. A JSON config file provides the list of feeds and the desired output format:

{
"output_format": "json",
"max_entries": 10,
"feeds": [{
"feed": "

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

",
"web": "

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

",
"name": "Perl Hacks"
}, {
"feed": "

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

",
"web": "

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

",
"name": "Substack"
}, {
"feed": "

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

",
"web": "

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

",
"name": "Davblog"
}, {
"feed": "

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

",
"web": "

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

",
"name": "Dev.to"
}, {
"feed": "

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

",
"web": "

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

",
"name": "Medium"
}]
}
  1. Each feed is fetched and parsed using

    Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

  2. For each entry, the linked page is scanned for a <link rel="canonical"> tag
  3. If found, that canonical URL is used to detect duplicates; if not, the entry’s title is used as a fallback
  4. Duplicates are discarded, keeping only one version (preferably canonical)
  5. The resulting list is sorted by date and emitted in Atom, RSS, or JSON
Installation and Usage


Install via CPAN:


cpanm App::FeedDeduplicator

Then run it with:


feed-deduplicator config.json

If no config file is specified, it will try the FEED_DEDUP_CONFIG environment variable or fallback to ~/.feed-deduplicator/config.json.

There’s also a

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

with the latest version installed.

Under the Hood


The tool is written in Perl 5.38+ and uses the new class feature (

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

) for a cleaner OO structure:

  • App::FeedDeduplicator::Aggregator handles feed downloading and parsing
  • App::FeedDeduplicator::Deduplicator detects and removes duplicates
  • App::FeedDeduplicator::Publisher generates the final output
What’s Next?


It’s all very much a work in progress at the moment. It works for me, but there are bound to be some improvements needed, so it works for more people. A few things I already know I want to improve:

  • Add a configuration option for the LWP::Useragent agent identifier string
  • Add configuration options for the fixed elements of the generated web feed (name, link and things like that)
  • Add a per-feed limit for the number of entries published (I can see a use case where someone wants to publish a single entry from each feed)
  • Some kind of configuration template for the JSON version of the output
Try It Out


If you want a clean, single-source feed that represents your writing without duplication, App::FeedDeduplicator might be just what you need.

I’m using it now to power the aggregated feed on my site. Let me know what you think!

The post

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

first appeared on

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу