Giter Club home page Giter Club logo

rssriver's Introduction

RSS River for Elasticsearch

Welcome to the RSS River Plugin for Elasticsearch

Versions

RSS River Plugin ElasticSearch
master (0.0.7) master (0.19)
0.0.6 0.19.0.RC1
0.0.5 0.18
0.0.4 0.18
0.0.3 0.18
0.0.2 0.17

Getting Started

Installation

Just type :

$ bin\plugin -install dadoonet/rssriver/0.0.6

This will do the job…

-> Installing dadoonet/rssriver/0.0.6...
Trying https://github.com/downloads/dadoonet/rssriver/rssriver-0.0.6.zip...
Downloading ...DONE
Installed rssriver

Creating a RSS river

We create first an index to store all the feed messages :

$ curl -XPUT 'localhost:9200/lemonde/' -d '{}'

We create the river with the following properties :

$ curl -XPUT 'localhost:9200/_river/lemonde/_meta' -d '{
  "type": "rss",
  "rss": {
    "feeds" : [ {
    	"name": "lemonde",
    	"url": "http://www.lemonde.fr/rss/une.xml",
    	"update_rate": 900000
    	}
    ]
  }
}'

If you need to get multiple feeds, you can add them :

$ curl -XPUT 'localhost:9200/actus/' -d '{}'

$ curl -XPUT 'localhost:9200/_river/actus/_meta' -d '{
  "type": "rss",
  "rss": {
    "feeds" : [ {
			"name": "lemonde",
			"url": "http://www.lemonde.fr/rss/une.xml",
			"update_rate": 900000
    	}, {
			"name": "lefigaro",
			"url": "http://rss.lefigaro.fr/lefigaro/laune",
			"update_rate" : 1800000
    	}
    ]
  }
}'

Working with mappings

When you create your index, you can specify the mapping you want to use as follow :

$ curl -XPUT 'http://localhost:9200/lefigaro/' -d '

$ curl -XPUT 'http://localhost:9200/lefigaro/page/_mapping' -d '{
    "page" : {
        "properties" : {
            "feedname" : {"type" : "string"},
            "title" : {"type" : "string", "analyzer" : "french"},
            "description" : {"type" : "string", "analyzer" : "french"},
            "author" : {"type" : "string"},
            "link" : {"type" : "string"}
        }
    }
}'

Then, your feed will use it when you create the river :

$ curl -XPUT 'localhost:9200/_river/lefigaro/_meta' -d '{
  "type": "rss",
  "rss": {
    "feeds" : [ {
		    "url": "http://rss.lefigaro.fr/lefigaro/laune"
	    }
    ]
  }
}'

Behind the scene

RSS river downloads RSS feed every update_rate milliseconds and check if there is new messages.

At first, RSS river look at the <channel> tag.
It reads the optional <pubDate> tag and store it in Elastic Search to compare it on next launch.

Then, for each <item> tag, RSS river creates a new document within page type with the following properties :

XML Tag ES Mapping
<title> title
<description> description
<author> author
<link> link
<geo:lat> <geo:long> location

ID is generated from description using the UUID generator. So, each message is indexed only once.

Read RSS 2.0 Specification for more details about RSS channels.

To Do List

Many many things to do :

  • As <pubDate> tag is optional, we have to check if RSS River is working in that case and parse each feed message
  • Support more RSS <channel> sub-elements, such as <category>, <skipDays>, <skipHours>
  • Support more RSS <item> sub-elements, such as <category>, <enclosure>, <pubDate>
  • Support for multi-channel (one per language for instance)
  • Use <ttl> to manage sleep time of the river
  • Use <guid> as the text to encode to generate ID

rssriver's People

Contributors

dadoonet avatar nglx avatar obazoud avatar

Watchers

Christian Hochfilzer avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.