0
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-06-30 02:31:07 +00:00
rss-bridge/docs/09_Technical_recommendations/index.md
Dawid Wróbel b7c04f8587
Overhaul the usage of libcurl-impersonate (#4535)
libcurl-impersonate was not being used properly, as the code was
overriding the headers set by it to prevent detection.

- update the libcurl-impersonate to an actively managed lexiforest
  fork
- impersonate Chrome 131
- move the defaultHttpHeaders to http.php, where it belongs
- only set defaultHttpHeaders if curl-impersonate is not detected
- make useragent ini setting optional and disabled by default
- add necessary documentation updates
2025-05-17 20:18:36 +02:00

33 lines
997 B
Markdown

## General recommendations
## Test a site before building a bridge
Some sites make use of anti-bot mechanisms (e.g.: by using JavaScript) in which case they work fine in regular browsers,
but not in the PHP environment. RSS-Bridge Docker container by default resorts to using libcurl-impersonate, which helps mitigating anti-bot mechanisms.
To check if a site works with RSS-Bridge, create a new bridge using the
[template](../05_Bridge_API/02_BridgeAbstract.md#template)
and load a valid URL (not the base URL!).
**Example (using github.com)**
```PHP
<?php
class TestBridge extends BridgeAbstract
{
const NAME = 'Unnamed bridge';
const URI = '';
const DESCRIPTION = 'No description provided';
const MAINTAINER = 'No maintainer';
const PARAMETERS = [];
const CACHE_TIMEOUT = 3600;
public function collectData()
{
$html = getSimpleHTMLDOM('https://github.com/rss-bridge/rss-bridge');
}
}
```
This bridge should return an empty page (HTML format)