diff --git a/.dockerignore b/.dockerignore index 15154f0d..f2bc0e8d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,5 +4,4 @@ DEBUG Dockerfile whitelist.txt phpcs.xml -CHANGELOG.md CONTRIBUTING.md \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index 412eeda7..a141bb12 100644 --- a/.gitattributes +++ b/.gitattributes @@ -20,3 +20,17 @@ *.PDF diff=astextplain *.rtf diff=astextplain *.RTF diff=astextplain + +# Ignore files in git archive (i.e. GitHub release builds) +Dockerfile export-ignore +.travis.yml export-ignore +.github/ export-ignore +.gitattributes export-ignore +.gitignore export-ignore +.dockerignore export-ignore +scalingo.json export-ignore +phpunit.xml export-ignore +phpcs.xml export-ignore +phpcompatibility.xml export-ignore +tests/ export-ignore +cache/.gitkeep export-ignore \ No newline at end of file diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 00000000..ec47ab0d --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,49 @@ +### Pull request policy + +* [Fix one issue per pull request](https://github.com/RSS-Bridge/rss-bridge/wiki/Pull-request-policy#fix-one-issue-per-pull-request) +* [Respect the coding style policy](https://github.com/RSS-Bridge/rss-bridge/wiki/Pull-request-policy#respect-the-coding-style-policy) +* [Properly name your commits](https://github.com/RSS-Bridge/rss-bridge/wiki/Pull-request-policy#properly-name-your-commits) + * When fixing a bridge (located in the `bridges` directory), write `[BridgeName] Feature`
(i.e. `[YoutubeBridge] Fix typo in video titles`). + * When fixing other files, use `[FileName] Feature`
(i.e. `[index.php] Add multilingual support`). + * When fixing a general problem that applies to multiple files, write `category: feature`
(i.e. `bridges: Fix various typos`). + +Note that all pull-requests must pass all tests before they can be merged. + +### Coding style + +* [Whitespace](https://github.com/RSS-Bridge/rss-bridge/wiki/Whitespace) + * [Add a new line at the end of a file](https://github.com/RSS-Bridge/rss-bridge/wiki/Whitespace#add-a-new-line-at-the-end-of-a-file) + * [Do not add a whitespace before a semicolon](https://github.com/RSS-Bridge/rss-bridge/wiki/Whitespace#add-a-new-line-at-the-end-of-a-file) + * [Do not add whitespace at start or end of a file or end of a line](https://github.com/RSS-Bridge/rss-bridge/wiki/Whitespace#do-not-add-whitespace-at-start-or-end-of-a-file-or-end-of-a-line) +* [Indentation](https://github.com/RSS-Bridge/rss-bridge/wiki/Indentation) + * [Use tabs for indentation](https://github.com/RSS-Bridge/rss-bridge/wiki/Indentation#use-tabs-for-indentation) +* [Maximum line length](https://github.com/RSS-Bridge/rss-bridge/wiki/Maximum-line-length) + * [The maximum line length should not exceed 80 characters](https://github.com/RSS-Bridge/rss-bridge/wiki/Maximum-line-length#the-maximum-line-length-should-not-exceed-80-characters) +* [Strings](https://github.com/RSS-Bridge/rss-bridge/wiki/Strings) + * [Whenever possible use single quoted strings](https://github.com/RSS-Bridge/rss-bridge/wiki/Strings#whenever-possible-use-single-quote-strings) + * [Add spaces around the concatenation operator](https://github.com/RSS-Bridge/rss-bridge/wiki/Strings#add-spaces-around-the-concatenation-operator) + * [Use a single string instead of concatenating](https://github.com/RSS-Bridge/rss-bridge/wiki/Strings#use-a-single-string-instead-of-concatenating) +* [Constants](https://github.com/RSS-Bridge/rss-bridge/wiki/Constants) + * [Use UPPERCASE for constants](https://github.com/RSS-Bridge/rss-bridge/wiki/Constants#use-uppercase-for-constants) +* [Keywords](https://github.com/RSS-Bridge/rss-bridge/wiki/Keywords) + * [Use lowercase for `true`, `false` and `null`](https://github.com/RSS-Bridge/rss-bridge/wiki/Keywords#use-lowercase-for-true-false-and-null) +* [Operators](https://github.com/RSS-Bridge/rss-bridge/wiki/Operators) + * [Operators must have a space around them](https://github.com/RSS-Bridge/rss-bridge/wiki/Operators#operators-must-have-a-space-around-them) +* [Functions](https://github.com/RSS-Bridge/rss-bridge/wiki/Functions) + * [Parameters with default values must appear last in functions](https://github.com/RSS-Bridge/rss-bridge/wiki/Functions#parameters-with-default-values-must-appear-last-in-functions) + * [Calling functions](https://github.com/RSS-Bridge/rss-bridge/wiki/Functions#calling-functions) + * [Do not add spaces after opening or before closing bracket](https://github.com/RSS-Bridge/rss-bridge/wiki/Functions#do-not-add-spaces-after-opening-or-before-closing-bracket) +* [Structures](https://github.com/RSS-Bridge/rss-bridge/wiki/Structures) + * [Structures must always be formatted as multi-line blocks](https://github.com/RSS-Bridge/rss-bridge/wiki/Structures#structures-must-always-be-formatted-as-multi-line-blocks) +* [If-Statement](https://github.com/RSS-Bridge/rss-bridge/wiki/if-Statement) + * [Use `elseif` instead of `else if`](https://github.com/RSS-Bridge/rss-bridge/wiki/if-Statement#use-elseif-instead-of-else-if) + * [Do not write empty statements](https://github.com/RSS-Bridge/rss-bridge/wiki/if-Statement#do-not-write-empty-statements) + * [Do not write unconditional if-statements](https://github.com/RSS-Bridge/rss-bridge/wiki/if-Statement#do-not-write-unconditional-if-statements) +* [Classes](https://github.com/RSS-Bridge/rss-bridge/wiki/Classes) + * [Use PascalCase for class names](https://github.com/RSS-Bridge/rss-bridge/wiki/Classes#use-pascalcase-for-class-names) + * [Do not use final statements inside final classes](https://github.com/RSS-Bridge/rss-bridge/wiki/Classes#do-not-use-final-statements-inside-final-classes) + * [Do not override methods to call their parent](https://github.com/RSS-Bridge/rss-bridge/wiki/Classes#do-not-override-methods-to-call-their-parent) + * [abstract and final declarations MUST precede the visibility declaration](https://github.com/RSS-Bridge/rss-bridge/wiki/Classes#abstract-and-final-declarations-must-precede-the-visibility-declaration) + * [static declaration MUST come after the visibility declaration](https://github.com/RSS-Bridge/rss-bridge/wiki/Classes#static-declaration-must-come-after-the-visibility-declaration) +* [Casting](https://github.com/RSS-Bridge/rss-bridge/wiki/Casting) + * [Do not add spaces when casting](https://github.com/RSS-Bridge/rss-bridge/wiki/Casting#do-not-add-spaces-when-casting) diff --git a/.github/ISSUE_TEMPLATE/bridge-request-template.md b/.github/ISSUE_TEMPLATE/bridge-request-template.md new file mode 100644 index 00000000..f4b1119f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bridge-request-template.md @@ -0,0 +1,61 @@ +--- +name: Bridge request template +about: Use this template for requesting a new bridge + +--- + +# Bridge request + + + +## General information + + + +- _Host URI for the bridge_ (i.e. `https://github.com`): + +- Which information would you like to see? + + + +- How should the information be displayed/formatted? + + + +- Which of the following parameters do you expect? + + - [X] Title + - [X] URI (link to the original article) + - [ ] Author + - [ ] Timestamp + - [X] Content (the content of the article) + - [ ] Enclosures (pictures, videos, etc...) + - [ ] Categories (categories, tags, etc...) + +## Options + + + +- [ ] Limit number of returned items + - _Default limit_: 5 +- [ ] Load full articles + - _Cache articles_ (articles are stored in a local cache on first request): yes + - _Cache timeout_ (max = 24 hours): 24 hours +- [X] Balance requests (RSS-Bridge uses cached versions to reduce bandwith usage) + - _Timeout_ (default = 5 minutes, max = 24 hours): 5 minutes + + + + diff --git a/.travis.yml b/.travis.yml index 5c746a4d..55210788 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,28 +1,36 @@ dist: trusty -sudo: false language: php install: - - if [[ $TRAVIS_PHP_VERSION == "hhvm" ]]; then - composer global require squizlabs/PHP_CodeSniffer; - else - pear channel-update pear.php.net; - pear install PHP_CodeSniffer; - fi + - composer global require dealerdirect/phpcodesniffer-composer-installer; + - composer global require phpcompatibility/php-compatibility; + # Use PHPUnit 6 for unit tests (stable), requires PHP 7 - if [[ $TRAVIS_PHP_VERSION == "7.0" ]]; then composer global require phpunit/phpunit ^6; fi + # Use latest PHPUnit on nightly to detect breaking changes + - if [[ $TRAVIS_PHP_VERSION == "nightly" ]]; then + composer global require phpunit/phpunit; + fi script: - phpenv rehash - - if [[ $TRAVIS_PHP_VERSION == "hhvm" ]]; then - /home/travis/.composer/vendor/bin/phpcs . --standard=phpcs.xml --warning-severity=0 --extensions=php -p; - else - phpcs . --standard=phpcs.xml --warning-severity=0 --extensions=php -p; + # Run PHP_CodeSniffer on all versions + - ~/.config/composer/vendor/bin/phpcs . --standard=phpcs.xml --warning-severity=0 --extensions=php -p; + # Check PHP compatibility for the lowest supported version + - if [[ $TRAVIS_PHP_VERSION == "5.6" ]]; then + ~/.config/composer/vendor/bin/phpcs . --standard=phpcompatibility.xml --extensions=php -p; fi + # Run unit tests (stable) - if [[ $TRAVIS_PHP_VERSION == "7.0" ]]; then phpunit --configuration=phpunit.xml --include-path=lib/; fi + # Run unit tests (latest/nightly) + # Check PHP compatibility for all versions, starting at the lowest supported version in order to detect breaking changes + - if [[ $TRAVIS_PHP_VERSION == "nightly" ]]; then + phpunit --configuration=phpunit.xml --include-path=lib/; + ~/.config/composer/vendor/bin/phpcs . --standard=PHPCompatibility --extensions=php -p --runtime-set testVersion 5.6-; + fi matrix: fast_finish: true @@ -30,9 +38,7 @@ matrix: include: - php: 5.6 - php: 7.0 - - php: hhvm - php: nightly allow_failures: - - php: hhvm - php: nightly diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 467040e6..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,263 +0,0 @@ -rss-bridge Changelog -=== - -RSS-Bridge 2017-08-19 -== - -## General changes -* whitelist: Do case-insensitive whitelist matching -* [FeedExpander] Fix Serialization of 'SimpleXMLElement' is not allowed -* [FeedExpander] Remove whitespace from source content -* [index] Add GET parameter 'q' for search queries - - **Example**: You can now add `&q=Twitter` to load into the search field -* [index] Check permissions for cache folder and whitelist file -* [index] Show bridge options when loading with URL fragment - - **Example**: You can now add `#bridge-Twitter` to load the card with all -parameters visible -* [style] Center search cursor and hide placeholder -* [validation] Fix error on undefined optional numeric value - -## Modified bridges -* [DanbooruBridge] Allow descendant classes to override tag collection -* [DribbbleBridge] Add dribble bridge listing last dribble popular shots (#558) -* [FacebookBridge] Fix & in URLs -* [GelbooruBridge] Fix bridge not getting tags correctly -* [GoComicsBridge] Fix for page structure changes (#568) -* [LeBonCoinBridge] Fix bridge is marked executable -* [LWNprevBridge] Fix everchanging url -* [YoutubeBridge] Fix error on certain keywords -* [YoutubeBridge] Fix issues loading playlists - -## Removed bridges -* VineBridge - -RSS-Bridge 2017-08-03 -== - -## Important changes -* RSS-Bridge now has [contribution guidelines](CONTRIBUTING.md) -* [phpcs rules](phpcs.xml) follow the [contribution guidelines](CONTRIBUTING.md) - -## General changes -* Added a search bar to make searching for bridges easier -* Added user friendly error page for when a bridge fails -* Added caching of extraInfos (name, uri) -* Added an indicator to warn for bridges using HTTP instead of HTTPS -* Various bug fixes and improvements - -## Modified bridges -* AllocineFRBridge] Update Faux Raccord link -* [DanbooruBridge] Fix broken URI -* [DuckDuckGoBridge] Disable DuckDuckGo redirects so that the links returned are correct. -* [FacebookBridge] Add option to hide posts with facebook videos -* [FacebookBridge] Add requester languages to HTTP header -* [FacebookBridge] Handle summary posts -* [FacebookBridge] Replace 'novideo' with 'media_type' -* [FilterBridge] Initial implementation of basic title permit and block -* [FlickrTagBridge] Fix and improve bridge by using the FlickrExploreBridge approach -* [GooglePlusPostBridge] Autofix user names -* [GooglePlusPostBridge] Fix bridge implementation -* [GooglePlusPostBridge] Fix content loading -* [InstagramBridge] Add option to filter for videos and pictures -* [LWNprevBridge] full rewrite -* [MangareaderBridge] Fix double forward slashes -* [NasaApodBridge] Use HTTPS instead of HTTP -* [PinterestBridge] Fix checkbox not working -* [PinterestBridge] Fix implementation after DOM changes -* [RTBFBridge] Update URI -* [SexactuBridge] Fix URI and timestamp -* [SexactuBridge] Use most modern version of bridge api and cached pages (#504) -* [ShanaprojectBridge] Don't throw error if timestamp is missing -* [TwitterBridge] Add option to hide retweets -* [TwitterBridge] Avoid empty content caused by new login policy -* [TwitterBridge] Fix double slashes in URI -* [TwitterBridge] Fix missing spaces -* [TwitterBridge] Fix title includes anchors in plaintext format -* [TwitterBridge] ignore promoted tweets -* [TwitterBridge] Optimize returned image sizes -* [TwitterBridge] Show quotes and pictures -* [WebfailBridge] Properly handle gifs (DOM changed) -* [YoutubeBridge] Improve readability of feed contents -* [YoutubeBridge] Improve URL handling in video descriptions - -## New bridges -* AmazonBridge -* DiceBridge -* EtsyBridge -* FB2Bridge -* FilterBridge -* FlickrBridge -* GithubSearchBridge -* GoComicsBridge -* KATBridge -* KernelBugTrackerBridge -* MixCloudBridge -* MoinMoinBridge -* RainbowSixSiegeBridge -* SteamBridge -* TheTVDBBridge -* Torrent9Bridge -* UsbekEtRicaBridge -* WikiLeaksBridge -* WordPressPluginUpdateBridge - -Alpha 0.2 -=== - -## Important changes -* RSS-Bridge has been [UNLICENSED](UNLICENSE) -* RSS-Bridge is now a community-managed project on [GitHub](https://github.com/rss-bridge/rss-bridge) -* RSS-Bridge now has a [Wiki](https://github.com/rss-bridge/rss-bridge/wiki) -* RSS-Bridge now supports [Travis-CI](https://travis-ci.org) - -## General changes -* Added [CHANGELOG](CHANGELOG.md) (this file) -* Added [PHP Simple HTML DOM Parser](http://simplehtmldom.sourceforge.net) to [vendor](vendor/simplehtmldom/) -* Added cache purging function (cache will be force-purged after 24 hours or as defined by bridge) -* Added new format [MrssFormat](formats/MrssFormat.php) -* Added parameter `author` - for display of the feed author name - to all formats -* Added new abstraction of the BridgeInterface: - - [FeedExpander](https://github.com/RSS-Bridge/rss-bridge/wiki/Bridge-API) -* Added optional support for proxy usage on each individual bridge -* Added support for [custom bridge parameter](https://github.com/RSS-Bridge/rss-bridge/wiki/BridgeAbstract#format-specifications) (text, number, list, checkbox) -* Changed design of the welcome screen -* Changed design of HtmlFormat -* Changed behavior of debug mode: - - Enable debug mode by placing a file called "DEBUG" in the root folder - - Debug mode automatically disables cache file loading -* Changed implementation of bridges - see [Wiki](https://github.com/rss-bridge/rss-bridge/wiki) - - Changed comment-style metadata to constants - - Added support for multiple utilizations per bridge - - Changed the parameter loading algorithm to be loaded by RSS-Bridge core -* Improved checks for PHP version, configuration and extensions -* Many bug fixes - -## Modified Bridges -* FlickrExploreBridge -* GoogleSearchBridge -* TwitterBridge - -## New Bridges -* ABCTabsBridge -* AcrimedBridge -* AllocineFRBridge -* AnimeUltimeBridge -* Arte7Bridge -* AskfmBridge -* BandcampBridge -* BastaBridge -* BlaguesDeMerdeBridge -* BooruprojectBridge -* CADBridge -* CNETBridge -* CastorusBridge -* CollegeDeFranceBridge -* CommonDreamsBridge -* CopieDoubleBridge -* CourrierInternationalBridge -* CpasbienBridge -* CryptomeBridge -* DailymotionBridge -* DanbooruBridge -* DansTonChatBridge -* DauphineLibereBridge -* DemoBridge -* DeveloppezDotComBridge -* DilbertBridge -* DollbooruBridge -* DuckDuckGoBridge -* EZTVBridge -* EliteDangerousGalnetBridge -* ElsevierBridge -* EstCeQuonMetEnProdBridge -* FacebookBridge -* FierPandaBridge -* FlickrTagBridge -* FootitoBridge -* FourchanBridge -* FuturaSciencesBridge -* GBAtempBridge -* GelbooruBridge -* GiphyBridge -* GithubIssueBridge -* GizmodoBridge -* GooglePlusPostBridge -* HDWallpapersBridge -* HentaiHavenBridge -* IdenticaBridge -* InstagramBridge -* IsoHuntBridge -* JapanExpoBridge -* KonachanBridge -* KoreusBridge -* KununuBridge -* LWNprevBridge -* LeBonCoinBridge -* LegifranceJOBridge -* LeMondeInformatiqueBridge -* LesJoiesDuCodeBridge -* LichessBridge -* LinkedInCompanyBridge -* LolibooruBridge -* MangareaderBridge -* MilbooruBridge -* MoebooruBridge -* MondeDiploBridge -* MsnMondeBridge -* MspabooruBridge -* NasaApodBridge -* NeuviemeArtBridge -* NextInpactBridge -* NextgovBridge -* NiceMatinBridge -* NovelUpdatesBridge -* OpenClassroomsBridge -* ParuVenduImmoBridge -* PickyWallpapersBridge -* PinterestBridge -* PlanetLibreBridge -* RTBFBridge -* ReadComicsBridge -* Releases3DSBridge -* ReporterreBridge -* Rue89Bridge -* Rule34Bridge -* Rule34pahealBridge -* SafebooruBridge -* SakugabooruBridge -* ScmbBridge -* ScoopItBridge -* SensCritiqueBridge -* SexactuBridge -* ShanaprojectBridge -* Shimmie2Bridge -* SoundcloudBridge -* StripeAPIChangeLogBridge -* SuperbWallpapersBridge -* T411Bridge -* TagBoardBridge -* TbibBridge -* TheCodingLoveBridge -* TheHackerNewsBridge -* ThePirateBayBridge -* UnsplashBridge -* ViadeoCompanyBridge -* VineBridge -* VkBridge -* WallpaperStopBridge -* WebfailBridge -* WeLiveSecurityBridge -* WhydBridge -* WikipediaBridge -* WordPressBridge -* WorldOfTanksBridge -* XbooruBridge -* YandereBridge -* YoutubeBridge -* ZDNetBridge - -Alpha 0.1 -=== -* First tagged version. -* Includes refactoring. -* Unstable. \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index e03f926e..00000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,47 +0,0 @@ -### Pull request policy -Fix one issue per pull request. -Squash commits before opening a pull request. -Respect the coding style policy. -Name your PR like the following : - -* When correcting a single bridge, use `[BridgeName] Feature`. -* When fixing a problem in a specific file, use `[FileName] Feature`. -* When fixing a general problem, use `category : feature`. - -Note that all pull-requests should pass the unit tests before they can be merged. - -### Coding style - -Use `camelCase` for variables and methods. -Use `UPPERCASE` for constants. -Use `PascalCase` for class names. When creating a bridge, your class and PHP file should be named `MyImplementationBridge`. -Use tabs for indentation. -Add an empty line at the end of your file. - -Use `''` to encapsulate strings, including in arrays. -Prefer lines shorter than 80 chars, no line longer than 120 chars. -PHP constants should be in lower case (`true, false, null`...) - - -* Add spaces between the logical operator and your expressions (not needed for the `!` operator). -* Use `||` and `&&` instead of `or` and `and`. -* Add space between your condition and the opening bracket/closing bracket. -* Don't put a space between `if` and your bracket. -* Use `elseif` instead of `else if`. -* Add new lines in your conditions if they are containing more than one line. -* Example : - -```PHP -if($a == true && $b) { - print($a); -} else if(!$b) { - - $a = !$a; - $b = $b >> $a; - print($b); - -} else { - print($b); -} -``` - diff --git a/README.md b/README.md index 1fcf6023..4e2c7b1c 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ rss-bridge RSS-Bridge is a PHP project capable of generating RSS and Atom feeds for websites which don't have one. It can be used on webservers or as stand alone application in CLI mode. +**Important**: RSS-Bridge is __not__ a feed reader or feed aggregator, but a tool to generate feeds that are consumed by feed readers and feed aggregators. Find a list of feed aggregators on [Wikipedia](https://en.wikipedia.org/wiki/Comparison_of_feed_aggregators). + Supported sites/pages (examples) === @@ -108,88 +110,98 @@ Use this script to generate the list automatically (using the GitHub API): https://gist.github.com/LogMANOriginal/da00cd1e5f0ca31cef8e193509b17fd8 --> - * [16mhz](https://api.github.com/users/16mhz) - * [Ahiles3005](https://api.github.com/users/Ahiles3005) - * [Albirew](https://api.github.com/users/Albirew) - * [AmauryCarrade](https://api.github.com/users/AmauryCarrade) - * [ArthurHoaro](https://api.github.com/users/ArthurHoaro) - * [Astalaseven](https://api.github.com/users/Astalaseven) - * [Astyan-42](https://api.github.com/users/Astyan-42) - * [Daiyousei](https://api.github.com/users/Daiyousei) - * [Djuuu](https://api.github.com/users/Djuuu) - * [Draeli](https://api.github.com/users/Draeli) - * [EtienneM](https://api.github.com/users/EtienneM) - * [Frenzie](https://api.github.com/users/Frenzie) - * [Ginko-Aloe](https://api.github.com/users/Ginko-Aloe) - * [Glandos](https://api.github.com/users/Glandos) - * [GregThib](https://api.github.com/users/GregThib) - * [Grummfy](https://api.github.com/users/Grummfy) - * [JackNUMBER](https://api.github.com/users/JackNUMBER) - * [JeremyRand](https://api.github.com/users/JeremyRand) - * [Jocker666z](https://api.github.com/users/Jocker666z) - * [LogMANOriginal](https://api.github.com/users/LogMANOriginal) - * [MonsieurPoutounours](https://api.github.com/users/MonsieurPoutounours) - * [ORelio](https://api.github.com/users/ORelio) - * [PaulVayssiere](https://api.github.com/users/PaulVayssiere) - * [Piranhaplant](https://api.github.com/users/Piranhaplant) - * [Riduidel](https://api.github.com/users/Riduidel) - * [Strubbl](https://api.github.com/users/Strubbl) - * [TheRadialActive](https://api.github.com/users/TheRadialActive) - * [TwizzyDizzy](https://api.github.com/users/TwizzyDizzy) - * [WalterBarrett](https://api.github.com/users/WalterBarrett) - * [ZeNairolf](https://api.github.com/users/ZeNairolf) - * [adamchainz](https://api.github.com/users/adamchainz) - * [aledeg](https://api.github.com/users/aledeg) - * [alexAubin](https://api.github.com/users/alexAubin) - * [az5he6ch](https://api.github.com/users/az5he6ch) - * [b1nj](https://api.github.com/users/b1nj) - * [benasse](https://api.github.com/users/benasse) - * [captn3m0](https://api.github.com/users/captn3m0) - * [chemel](https://api.github.com/users/chemel) - * [ckiw](https://api.github.com/users/ckiw) - * [cnlpete](https://api.github.com/users/cnlpete) - * [corenting](https://api.github.com/users/corenting) - * [da2x](https://api.github.com/users/da2x) - * [eMerzh](https://api.github.com/users/eMerzh) - * [em92](https://api.github.com/users/em92) - * [griffaurel](https://api.github.com/users/griffaurel) - * [hunhejj](https://api.github.com/users/hunhejj) - * [j0k3r](https://api.github.com/users/j0k3r) - * [jdigilio](https://api.github.com/users/jdigilio) - * [kranack](https://api.github.com/users/kranack) - * [kraoc](https://api.github.com/users/kraoc) - * [laBecasse](https://api.github.com/users/laBecasse) - * [lagaisse](https://api.github.com/users/lagaisse) - * [lalannev](https://api.github.com/users/lalannev) - * [ldidry](https://api.github.com/users/ldidry) - * [m0zes](https://api.github.com/users/m0zes) - * [matthewseal](https://api.github.com/users/matthewseal) - * [mcbyte-it](https://api.github.com/users/mcbyte-it) - * [mdemoss](https://api.github.com/users/mdemoss) - * [melangue](https://api.github.com/users/melangue) - * [metaMMA](https://api.github.com/users/metaMMA) - * [mickael-bertrand](https://api.github.com/users/mickael-bertrand) - * [mitsukarenai](https://api.github.com/users/mitsukarenai) - * [mro](https://api.github.com/users/mro) - * [mxmehl](https://api.github.com/users/mxmehl) - * [nel50n](https://api.github.com/users/nel50n) - * [niawag](https://api.github.com/users/niawag) - * [pellaeon](https://api.github.com/users/pellaeon) - * [pit-fgfjiudghdf](https://api.github.com/users/pit-fgfjiudghdf) - * [pitchoule](https://api.github.com/users/pitchoule) - * [pmaziere](https://api.github.com/users/pmaziere) - * [prysme01](https://api.github.com/users/prysme01) - * [quentinus95](https://api.github.com/users/quentinus95) - * [qwertygc](https://api.github.com/users/qwertygc) - * [regisenguehard](https://api.github.com/users/regisenguehard) - * [rogerdc](https://api.github.com/users/rogerdc) - * [sebsauvage](https://api.github.com/users/sebsauvage) - * [sublimz](https://api.github.com/users/sublimz) - * [sysadminstory](https://api.github.com/users/sysadminstory) - * [tameroski](https://api.github.com/users/tameroski) - * [teromene](https://api.github.com/users/teromene) - * [triatic](https://api.github.com/users/triatic) - * [wtuuju](https://api.github.com/users/wtuuju) + * [16mhz](https://github.com/16mhz) + * [Ahiles3005](https://github.com/Ahiles3005) + * [Albirew](https://github.com/Albirew) + * [AmauryCarrade](https://github.com/AmauryCarrade) + * [AntoineTurmel](https://github.com/AntoineTurmel) + * [ArthurHoaro](https://github.com/ArthurHoaro) + * [Astalaseven](https://github.com/Astalaseven) + * [Astyan-42](https://github.com/Astyan-42) + * [Daiyousei](https://github.com/Daiyousei) + * [Djuuu](https://github.com/Djuuu) + * [Draeli](https://github.com/Draeli) + * [EtienneM](https://github.com/EtienneM) + * [Frenzie](https://github.com/Frenzie) + * [Ginko-Aloe](https://github.com/Ginko-Aloe) + * [Glandos](https://github.com/Glandos) + * [GregThib](https://github.com/GregThib) + * [Grummfy](https://github.com/Grummfy) + * [JackNUMBER](https://github.com/JackNUMBER) + * [JeremyRand](https://github.com/JeremyRand) + * [Jocker666z](https://github.com/Jocker666z) + * [LogMANOriginal](https://github.com/LogMANOriginal) + * [MonsieurPoutounours](https://github.com/MonsieurPoutounours) + * [Nono-m0le](https://github.com/Nono-m0le) + * [ORelio](https://github.com/ORelio) + * [PaulVayssiere](https://github.com/PaulVayssiere) + * [Piranhaplant](https://github.com/Piranhaplant) + * [Riduidel](https://github.com/Riduidel) + * [Roliga](https://github.com/Roliga) + * [Strubbl](https://github.com/Strubbl) + * [TheRadialActive](https://github.com/TheRadialActive) + * [TwizzyDizzy](https://github.com/TwizzyDizzy) + * [WalterBarrett](https://github.com/WalterBarrett) + * [ZeNairolf](https://github.com/ZeNairolf) + * [adamchainz](https://github.com/adamchainz) + * [aledeg](https://github.com/aledeg) + * [alexAubin](https://github.com/alexAubin) + * [az5he6ch](https://github.com/az5he6ch) + * [b1nj](https://github.com/b1nj) + * [benasse](https://github.com/benasse) + * [captn3m0](https://github.com/captn3m0) + * [chemel](https://github.com/chemel) + * [ckiw](https://github.com/ckiw) + * [cnlpete](https://github.com/cnlpete) + * [corenting](https://github.com/corenting) + * [couraudt](https://github.com/couraudt) + * [da2x](https://github.com/da2x) + * [disk0x](https://github.com/disk0x) + * [eMerzh](https://github.com/eMerzh) + * [em92](https://github.com/em92) + * [fluffy-critter](https://github.com/fluffy-critter) + * [fulmeek](https://github.com/fulmeek) + * [griffaurel](https://github.com/griffaurel) + * [hunhejj](https://github.com/hunhejj) + * [j0k3r](https://github.com/j0k3r) + * [jdigilio](https://github.com/jdigilio) + * [kranack](https://github.com/kranack) + * [kraoc](https://github.com/kraoc) + * [laBecasse](https://github.com/laBecasse) + * [lagaisse](https://github.com/lagaisse) + * [lalannev](https://github.com/lalannev) + * [ldidry](https://github.com/ldidry) + * [lorenzos](https://github.com/lorenzos) + * [m0zes](https://github.com/m0zes) + * [matthewseal](https://github.com/matthewseal) + * [mcbyte-it](https://github.com/mcbyte-it) + * [mdemoss](https://github.com/mdemoss) + * [melangue](https://github.com/melangue) + * [metaMMA](https://github.com/metaMMA) + * [mickael-bertrand](https://github.com/mickael-bertrand) + * [mitsukarenai](https://github.com/mitsukarenai) + * [mr-flibble](https://github.com/mr-flibble) + * [mro](https://github.com/mro) + * [mxmehl](https://github.com/mxmehl) + * [nel50n](https://github.com/nel50n) + * [niawag](https://github.com/niawag) + * [pellaeon](https://github.com/pellaeon) + * [pit-fgfjiudghdf](https://github.com/pit-fgfjiudghdf) + * [pitchoule](https://github.com/pitchoule) + * [pmaziere](https://github.com/pmaziere) + * [prysme01](https://github.com/prysme01) + * [quentinus95](https://github.com/quentinus95) + * [qwertygc](https://github.com/qwertygc) + * [regisenguehard](https://github.com/regisenguehard) + * [rogerdc](https://github.com/rogerdc) + * [sebsauvage](https://github.com/sebsauvage) + * [sublimz](https://github.com/sublimz) + * [sysadminstory](https://github.com/sysadminstory) + * [tameroski](https://github.com/tameroski) + * [teromene](https://github.com/teromene) + * [triatic](https://github.com/triatic) + * [wtuuju](https://github.com/wtuuju) + * [yardenac](https://github.com/yardenac) Licenses === diff --git a/bridges/ABCTabsBridge.php b/bridges/ABCTabsBridge.php index 2e451e28..ef2c75b1 100644 --- a/bridges/ABCTabsBridge.php +++ b/bridges/ABCTabsBridge.php @@ -8,7 +8,7 @@ class ABCTabsBridge extends BridgeAbstract { public function collectData(){ $html = ''; - $html = getSimpleHTMLDOM(static::URI.'tablatures/nouveautes.html') + $html = getSimpleHTMLDOM(static::URI . 'tablatures/nouveautes.html') or returnClientError('No results for this query.'); $table = $html->find('table#myTable', 0)->children(1); diff --git a/bridges/AcrimedBridge.php b/bridges/AcrimedBridge.php index 8b40d1d5..7e0fb6b2 100644 --- a/bridges/AcrimedBridge.php +++ b/bridges/AcrimedBridge.php @@ -21,5 +21,4 @@ class AcrimedBridge extends FeedExpander { return $item; } - } diff --git a/bridges/AllocineFRBridge.php b/bridges/AllocineFRBridge.php index 959d0efa..50a41ec7 100644 --- a/bridges/AllocineFRBridge.php +++ b/bridges/AllocineFRBridge.php @@ -45,7 +45,7 @@ class AllocineFRBridge extends BridgeAbstract { public function getName(){ if(!is_null($this->getInput('category'))) { return self::NAME . ' : ' - .array_search( + . array_search( $this->getInput('category'), self::PARAMETERS[$this->queriedContext]['category']['values'] ); @@ -83,5 +83,4 @@ class AllocineFRBridge extends BridgeAbstract { } } } - } diff --git a/bridges/AmazonBridge.php b/bridges/AmazonBridge.php index cbc61190..c9d4dc9c 100644 --- a/bridges/AmazonBridge.php +++ b/bridges/AmazonBridge.php @@ -52,7 +52,7 @@ class AmazonBridge extends BridgeAbstract { public function getName(){ if(!is_null($this->getInput('tld')) && !is_null($this->getInput('q'))) { - return 'Amazon.'.$this->getInput('tld').': '.$this->getInput('q'); + return 'Amazon.' . $this->getInput('tld') . ': ' . $this->getInput('q'); } return parent::getName(); @@ -60,8 +60,8 @@ class AmazonBridge extends BridgeAbstract { public function collectData() { - $uri = 'https://www.amazon.'.$this->getInput('tld').'/'; - $uri .= 's/?field-keywords='.urlencode($this->getInput('q')).'&sort='.$this->getInput('sort'); + $uri = 'https://www.amazon.' . $this->getInput('tld') . '/'; + $uri .= 's/?field-keywords=' . urlencode($this->getInput('q')) . '&sort=' . $this->getInput('sort'); $html = getSimpleHTMLDOM($uri) or returnServerError('Could not request Amazon.'); @@ -72,6 +72,9 @@ class AmazonBridge extends BridgeAbstract { // Title $title = $element->find('h2', 0); + if (is_null($title)) { + continue; + } $item['title'] = html_entity_decode($title->innertext, ENT_QUOTES); @@ -86,7 +89,7 @@ class AmazonBridge extends BridgeAbstract { $price = $element->find('span.s-price', 0); $price = ($price) ? $price->innertext : ''; - $item['content'] = '
'.$price; + $item['content'] = '
' . $price; $this->items[] = $item; } diff --git a/bridges/AnidexBridge.php b/bridges/AnidexBridge.php index a89cb567..ae387c90 100644 --- a/bridges/AnidexBridge.php +++ b/bridges/AnidexBridge.php @@ -140,7 +140,7 @@ class AnidexBridge extends BridgeAbstract { if (strpos($link->href, '/torrent/') === 0 && !in_array($link->href, $results)) $results[] = $link->href; if (empty($results) && empty($this->getInput('q'))) - returnServerError('No results from Anidex: '.$search_url); + returnServerError('No results from Anidex: ' . $search_url); //Process each item individually foreach ($results as $element) { @@ -156,7 +156,7 @@ class AnidexBridge extends BridgeAbstract { if ($torrent_id != 0 && ctype_digit($torrent_id)) { //Retrieve data for this torrent ID - $item_uri = self::URI . 'torrent/'.$torrent_id; + $item_uri = self::URI . 'torrent/' . $torrent_id; //Retrieve full description from torrent page if ($item_html = getSimpleHTMLDOMCached($item_uri)) { diff --git a/bridges/AnimeUltimeBridge.php b/bridges/AnimeUltimeBridge.php index 5c719b92..bc1dd7bc 100644 --- a/bridges/AnimeUltimeBridge.php +++ b/bridges/AnimeUltimeBridge.php @@ -137,5 +137,4 @@ class AnimeUltimeBridge extends BridgeAbstract { return parent::getName(); } - } diff --git a/bridges/Arte7Bridge.php b/bridges/Arte7Bridge.php index 12588c60..ff722113 100644 --- a/bridges/Arte7Bridge.php +++ b/bridges/Arte7Bridge.php @@ -119,5 +119,4 @@ class Arte7Bridge extends BridgeAbstract { $this->items[] = $item; } } - } diff --git a/bridges/AskfmBridge.php b/bridges/AskfmBridge.php index e2274618..b76d51b3 100644 --- a/bridges/AskfmBridge.php +++ b/bridges/AskfmBridge.php @@ -1,7 +1,7 @@ getURI()) or returnServerError('Requested username can\'t be found.'); - foreach($html->find('div.streamItem-answer') as $element) { + $html = defaultLinkTo($html, self::URI); + + foreach($html->find('article.streamItem-answer') as $element) { $item = array(); - $item['uri'] = self::URI . $element->find('a.streamItemsAge', 0)->href; - $question = trim($element->find('h1.streamItemContent-question', 0)->innertext); + $item['uri'] = $element->find('a.streamItem_meta', 0)->href; + $question = trim($element->find('header.streamItem_header', 0)->innertext); $item['title'] = trim( - htmlspecialchars_decode($element->find('h1.streamItemContent-question', 0)->plaintext, + htmlspecialchars_decode($element->find('header.streamItem_header', 0)->plaintext, ENT_QUOTES ) ); - $answer = trim($element->find('p.streamItemContent-answer', 0)->innertext); + $item['timestamp'] = strtotime($element->find('time', 0)->datetime); - // Doesn't work, DOM parser doesn't seem to like data-hint, dunno why - #$item['update'] = $element->find('a.streamitemsage',0)->data-hint; + $answer = trim($element->find('div.streamItem_content', 0)->innertext); // This probably should be cleaned up, especially for YouTube embeds - $visual = $element->find('div.streamItemContent-visual', 0)->innertext; - //Fix tracking links, also doesn't work + if($visual = $element->find('div.streamItem_visual', 0)) { + $visual = $visual->innertext; + } + + // Fix tracking links, also doesn't work foreach($element->find('a') as $link) { if(strpos($link->href, 'l.ask.fm') !== false) { - - // Too slow - #$link->href = str_replace('#_=_', '', get_headers($link->href, 1)['Location']); - $link->href = $link->plaintext; } } - $content = '

' . $question . '

' . $answer . '

' . $visual . '

'; - // Fix relative links without breaking // scheme used by YouTube stuff - $content = preg_replace('#href="\/(?!\/)#', 'href="' . self::URI, $content); - $item['content'] = $content; + $item['content'] = '

' . $question + . '

' . $answer + . '

' . $visual . '

'; + $this->items[] = $item; } } @@ -66,7 +66,7 @@ class AskfmBridge extends BridgeAbstract { public function getURI(){ if(!is_null($this->getInput('u'))) { - return self::URI . urlencode($this->getInput('u')) . '/answers/more?page=0'; + return self::URI . urlencode($this->getInput('u')); } return parent::getURI(); diff --git a/bridges/AutoJMBridge.php b/bridges/AutoJMBridge.php index b48a22a5..598f0431 100644 --- a/bridges/AutoJMBridge.php +++ b/bridges/AutoJMBridge.php @@ -19,6 +19,10 @@ class AutoJMBridge extends BridgeAbstract { ); const CACHE_TIMEOUT = 3600; + public function getIcon() { + return self::URI . 'assets/images/favicon.ico'; + } + public function collectData() { $html = getSimpleHTMLDOM(self::URI . $this->getInput('url')) or returnServerError('Could not request AutoJM.'); @@ -43,7 +47,7 @@ class AutoJMBridge extends BridgeAbstract { $item = array(); $item['uri'] = $url; $item['title'] = $serie; - $item['content'] = '

'. $serie . '

'; + $item['content'] = '

' . $serie . '

'; $item['content'] .= '