Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/deploy/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ When using our new config, please leave the following environment vairable blank

:::

`HOTLINK_TEMPLATE`: replace image URL in the description to avoid anti-hotlink protection, leave it blank to disable this function. Usage reference [#2769](https://github.com/DIYgod/RSSHub/issues/2769). You may use any property listed in [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL#Properties) (suffixing with `_ue` results in URL encoding), format of JS template literal. e.g. `${protocol}//${host}${pathname}`, `https://i3.wp.com/${host}${pathname}`, `https://images.weserv.nl?url=${href_ue}`
`HOTLINK_TEMPLATE`: replace image URL in the content to avoid anti-hotlink protection, leave it blank to disable this function. Usage reference [#2769](https://github.com/DIYgod/RSSHub/issues/2769). You may use any property listed in [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL#Properties) (suffixing with `_ue` results in URL encoding), format of JS template literal. e.g. `${protocol}//${host}${pathname}`, `https://i3.wp.com/${host}${pathname}`, `https://images.weserv.nl?url=${href_ue}`

`HOTLINK_INCLUDE_PATHS`: limit the routes to be processed, only matched routes will be processed. Set multiple values with comma `,` as delimiter. If not set, all routes will be processed

Expand Down
10 changes: 5 additions & 5 deletions src/guide/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ The following URL query parameters are supported, Regex support is built-in.

Set `filter` to include the content

- `filter`: filter `title` and description
- `filter`: filter `title` and `content`

- `filter_title`: filter `title` only

- `filter_description`: filter `description` only
- `filter_description`: filter `content` only

- `filter_author`: filter `author` only

Expand All @@ -47,11 +47,11 @@ E.g. [https://rsshub.app/dribbble/popular?filter=Blue|Yellow|Black](https://rssh

Set `filterout` to exclude unwanted content.

- `filterout`: filter `title` and description
- `filterout`: filter `title` and `content`

- `filterout_title`: filter `title` only

- `filterout_description`: filter `description` only
- `filterout_description`: filter `content` only

- `filterout_author`: filter `author` only

Expand Down Expand Up @@ -121,7 +121,7 @@ This is an experimental API

:::

- `image_hotlink_template`: replace image URL in the description to avoid anti-hotlink protection, leave it blank to disable this function. Usage reference [#2769](https://github.com/DIYgod/RSSHub/issues/2769). You may use any property listed in [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL#Properties) (suffixing with `_ue` results in URL encoding), format of JS template literal. e.g. `${protocol}//${host}${pathname}`, `https://i3.wp.com/${host}${pathname}`, `https://images.weserv.nl?url=${href_ue}`
- `image_hotlink_template`: replace image URL in the content to avoid anti-hotlink protection, leave it blank to disable this function. Usage reference [#2769](https://github.com/DIYgod/RSSHub/issues/2769). You may use any property listed in [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL#Properties) (suffixing with `_ue` results in URL encoding), format of JS template literal. e.g. `${protocol}//${host}${pathname}`, `https://i3.wp.com/${host}${pathname}`, `https://images.weserv.nl?url=${href_ue}`
- `multimedia_hotlink_template`: the same as `image_hotlink_template` but apply to audio and video. Note: the service must follow redirects, allow reverse-proxy for audio and video, and must drop the `Referer` header when reverse-proxying. [Here is an easy-to-deploy project that fits these requirements](https://github.com/Rongronggg9/rsstt-img-relay). The project accepts simple URL concatenation, e.g. `https://example.com/${href}`, in which `example.com` should be replaced with the domain name of the service you've deployed
- `wrap_multimedia_in_iframe`: wrap audio and video in `<iframe>` to prevent the reader from sending `Referer` header. This workaround is only compatible with a few readers, such as RSS Guard and Akregator, which may not support the previous method. You can try this method in such a case

Expand Down
5 changes: 3 additions & 2 deletions src/joinus/advanced/advanced-feed.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ Each item in an RSS feed is represented by an object with a set of fields that d
| :---------- | :---------- | :------------- | :------------ |
| **`title`** | *(Required)* The title of the item, which should be plain text only | `undefinded` | A, J, R |
| **`link`** | *(Recommended)* The URL of the item, which should link to a human-readable website | `undefinded` | A, J, R |
| **`description`** | *(Recommended)* The content of the item. For an Atom feed, it's the `atom:content` element. For a JSON feed, it's the `content_html` field | `undefinded` | A, J, R |
| **`content.html`** | *(Recommended)* The HTML content of the item. For an Atom feed, it's the `atom:content` element with the `type="html"` attribute. For a JSON feed, it's the `content_html` field. For an RSS feed, the equivalent field is `description` | `undefinded` | A, J, R |
| **`content.text`** | *(Optional)* The text content of the item. For an Atom feed, it's the `atom:content` element with the `type="text"` attribute. For a JSON feed, it's the `content_text` field. Can be used instead of `content.html`, or in addition to it for JSON feed | `undefined` | A, J |
| **`author`** | *(Optional)* The author of the item | `undefinded` | A, J, R |
| **`category`** | *(Optional)* The category of the item. You can use a plain string or an array of strings | `undefinded` | A, J, R |
| **`guid`** | *(Optional)* The unique identifier of the item | **`link || title`** | A, J, R |
Expand All @@ -59,7 +60,7 @@ When specifying certain fields in an RSS feed, it's important to keep in mind so

While most RSS readers will automatically trim these fields, some may not process them properly. Therefore, to ensure compatibility with all RSS readers, we recommend trimming these fields before outputting them. If your route cannot tolerate trimming these fields, you should consider changing their format.

Additionally, while other fields will not be forced to be trimmed, we suggest avoiding violations of the above formatting rules as much as possible. If you are using Cheerio to extract content from web pages, be aware that Cheerio will retain line breaks and indentation. For the **`item.description`** field, in particular, any intended linebreaks should be converted to `<br>` tags to prevent them from being trimmed by the RSS reader. If you're extracting an RSS feed from JSON data, be aware that the JSON may contain linebreaks that need to be displayed, so you should convert them to `<br>` tags in this case.
Additionally, while other fields will not be forced to be trimmed, we suggest avoiding violations of the above formatting rules as much as possible. If you are using Cheerio to extract content from web pages, be aware that Cheerio will retain line breaks and indentation. For the **`item.content.html`** field, in particular, any intended linebreaks should be converted to `<br>` tags to prevent them from being trimmed by the RSS reader. If you're extracting an RSS feed from JSON data, be aware that the JSON may contain linebreaks that need to be displayed, so you should convert them to `<br>` tags in this case.

It's important to keep these formatting considerations in mind to ensure your RSS feed is compatible with all RSS readers.

Expand Down
6 changes: 3 additions & 3 deletions src/joinus/advanced/script-standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const text = $('ul li.blue.sel').text() || $('li.blue.sel').text() || $('.blue.s
```

```javascript
const description = $('.content').html() || $('.content-container').html() || $('.root').html();
const content = $('.content').html() || $('.content-container').html() || $('.root').html();
```
:::

Expand Down Expand Up @@ -181,8 +181,8 @@ const item = {};
if (author) {
item.author = author;
}
if (description) {
item.description = description;
if (content) {
item.content.html = content;
}
```
:::
Expand Down
4 changes: 2 additions & 2 deletions src/joinus/advanced/use-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Here's an example of how you can use the cache to retrieve the data:
const { data: response } = await got(item.link);
const $ = load(response);

item.description = $('[class^="markdown-body"][class*="NewMarkdownViewer-module__safe-html-box__"]').first().html();
item.content.html = $('[class^="markdown-body"][class*="NewMarkdownViewer-module__safe-html-box__"]').first().html();

return item;
})
Expand All @@ -29,7 +29,7 @@ Here's an example of how you can use the cache to retrieve the data:

The above code snippet from [Create Your Own RSSHub Route](/joinus/new-rss/start-code#better-reading-experience) shows how to use the cache to get the full text of the first comment of each issue. `cache.tryGet()` is used to determine if the data is already available within the cache. If it's not, the code retrieves the data and stores it in the cache.

The object returned from the previous statement will be reused, and an extra `description` property will be added to it. The returned cache for each `item.link` will be `{ title, link, pubDate, author, category, description }`. The next time the same path is requested, this processed cache will be used instead of making a request to the server and recomputing the data.
The object returned from the previous statement will be reused, and an extra `content.html` property will be added to it. The returned cache for each `item.link` will be `{ title, link, pubDate, author, category, content.html }`. The next time the same path is requested, this processed cache will be used instead of making a request to the server and recomputing the data.

:::warning

Expand Down
14 changes: 7 additions & 7 deletions src/joinus/new-rss/start-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export const route: Route = {

### Construct and return results

Once we have retrieved the data from the API, we need to process it further to generate an RSS feed that conforms to the RSS specification. Specifically, we need to extract the channel title, channel link, item title, item link, item description, and item publication date.
Once we have retrieved the data from the API, we need to process it further to generate an RSS feed that conforms to the RSS specification. Specifically, we need to extract the channel title, channel link, item title, item link, item content, and item publication date.

For this, we can return the relevant data through the handler, and the RSSHub middleware will handle the rest.

Expand All @@ -237,8 +237,8 @@ export const route: Route = {
title: item.title,
// item link
link: item.html_url,
// item description
description: item.body_html,
// item content
content: { html: item.body_html },
// item publish date or time
pubDate: parseDate(item.created_at),
// item author, if available
Expand Down Expand Up @@ -351,7 +351,7 @@ export const route: Route = {

### Construct and return results

Once we have the data from the web page, we need to further process it to generate RSS in accordance with the RSS specification. Mainly, we need the channel title, channel link, item title, item link, item description, and item publication date.
Once we have the data from the web page, we need to further process it to generate RSS in accordance with the RSS specification. Mainly, we need the channel title, channel link, item title, item link, item content, and item publication date.

For this, we can return the relevant data through the handler, and the RSSHub middleware will handle the rest.

Expand Down Expand Up @@ -450,10 +450,10 @@ export const route: Route = {

// Select the first comment body as there are multiple comment bodies in each issue page,
// and we need to specify which one we want to use.
item.description = $('[class^="markdown-body"][class*="NewMarkdownViewer-module__safe-html-box__"]').first().html();
item.content.html = $('[class^="markdown-body"][class*="NewMarkdownViewer-module__safe-html-box__"]').first().html();

// Every property of a list item defined above is reused here
// and we add a new property 'description'
// and we add a new property 'content.html'
return item;
})
)
Expand Down Expand Up @@ -605,7 +605,7 @@ export const route: Route = {

const $ = load(response);

item.description = $('[class^="markdown-body"][class*="NewMarkdownViewer-module__safe-html-box__"]').first().html();
item.content.html = $('[class^="markdown-body"][class*="NewMarkdownViewer-module__safe-html-box__"]').first().html();

return item;
})
Expand Down