Added charset detection from HTTP headers. Fixes #1
This commit is contained in:
26
README.md
26
README.md
@ -1,10 +1,11 @@
|
||||
ttrss_plugin-af_feedmod
|
||||
=======================
|
||||
|
||||
Installation
|
||||
--------------------
|
||||
This is a plugin for Tiny Tiny RSS (tt-rss). It allows you to replace an article's contents by the contents of an element on the linked URL's page, i.e. create a "full feed".
|
||||
|
||||
This is a plugin for Tiny Tiny RSS (tt-rss). It allows you to replace an article's contents by the contents of an element on the linked URL's page.
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Checkout the directory into your plugins folder like this (from tt-RSS root directory):
|
||||
|
||||
@ -17,7 +18,7 @@ Then enable the plugin in preferences.
|
||||
|
||||
|
||||
Configuration
|
||||
--------------------
|
||||
-------------
|
||||
|
||||
The configuration is done in JSON format. In the preferences, you'll find a new tab called *FeedMod*. Use the large field to enter/modify the configuration data and click the **Save** button to store it.
|
||||
|
||||
@ -28,7 +29,8 @@ A configuration looks like this:
|
||||
|
||||
"heise.de": {
|
||||
"type": "xpath",
|
||||
"xpath": "div[@class='meldung_wrapper']"
|
||||
"xpath": "div[@class='meldung_wrapper']",
|
||||
"force_charset": "utf-8"
|
||||
},
|
||||
"berlin.de/polizei": {
|
||||
"type": "xpath",
|
||||
@ -41,6 +43,14 @@ A configuration looks like this:
|
||||
"golem0Bde0C": {
|
||||
"type": "xpath",
|
||||
"xpath": "article"
|
||||
},
|
||||
"oatmeal": {
|
||||
"type": "xpath",
|
||||
"xpath": "div[@id='comic']"
|
||||
},
|
||||
"blog.beetlebum.de": {
|
||||
"type": "xpath",
|
||||
"xpath": "div[@class='entry-content']"
|
||||
}
|
||||
|
||||
}
|
||||
@ -48,9 +58,11 @@ A configuration looks like this:
|
||||
|
||||
The *array key* is part of the URL of the article links(!). You'll notice the `golem0Bde0C` in the last entry: That's because all their articles link to something like `http://rss.feedsportal.com/c/33374/f/578068/p/1/s/3f6db44e/l/0L0Sgolem0Bde0Cnews0Cthis0Eis0Ean0Eexample0A10Erss0Bhtml/story01.htm` and to have the plugin match that URL and not interfere with other feeds using *feedsportal.com*, I used the part `golem0Bde0C`.
|
||||
|
||||
The **type** has to be `xpath` for now. Maybe there will be more types in the future.
|
||||
**type** has to be `xpath` for now. Maybe there will be more types in the future.
|
||||
|
||||
The **xpath** value is the actual Xpath-element to fetch from the linked page.
|
||||
The **xpath** value is the actual Xpath-element to fetch from the linked page. Omit the leading `//` - they will get prepended automatically.
|
||||
|
||||
**force_charset** allows to override automatic charset detection. If it is omitted, the charset will be parsed from the HTTP headers or loadHTML() will decide on its own.
|
||||
|
||||
|
||||
If you get an error about "Invalid JSON!", you can use [JSONLint](http://jsonlint.com/) to locate the erroneous part.
|
||||
|
Reference in New Issue
Block a user