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'] .= 'Series: ' . $objTitle->innertext . '
'; + } + + $objVolume = $cols[2]; + if ($objVolume && !empty($objVolume->plaintext)) + $title[] = 'Vol.' . $objVolume->plaintext; + + $objChapter = $cols[3]; + if ($objChapter && !empty($objChapter->plaintext)) + $title[] = 'Chp.' . $objChapter->plaintext; + + $objAuthor = $cols[4]; + if ($objAuthor && !empty($objAuthor->plaintext)) { + $item['author'] = html_entity_decode($objAuthor->plaintext); + $item['content'] .= 'Groups: ' . $objAuthor->innertext . '
'; + } + + $item['title'] = implode(' ', $title); + $item['uri'] = $this->getURI() . '#' . hash('sha1', $item['title']); + + $this->items[] = $item; + + if(count($this->items) >= $limit) { + break; + } + } + } + + public function getURI(){ + $series_id = $this->getInput('series_id'); + if (!empty($series_id)) { + return self::URI . 'releases.html?search=' . $series_id . '&stype=series'; + } + return self::URI; + } + + public function getName(){ + if(!empty($this->feedName)) { + return $this->feedName . ' - ' . self::NAME; + } + return parent::getName(); + } +} diff --git a/bridges/BandcampBridge.php b/bridges/BandcampBridge.php index 0527da03..9c8d436e 100644 --- a/bridges/BandcampBridge.php +++ b/bridges/BandcampBridge.php @@ -14,6 +14,10 @@ class BandcampBridge extends BridgeAbstract { ) )); + public function getIcon() { + return 'https://s4.bcbits.com/img/bc_favicon.ico'; + } + public function collectData(){ $html = getSimpleHTMLDOM($this->getURI()) or returnServerError('No results for this query.'); diff --git a/bridges/BlaguesDeMerdeBridge.php b/bridges/BlaguesDeMerdeBridge.php index 78deda0e..cae8f4f5 100644 --- a/bridges/BlaguesDeMerdeBridge.php +++ b/bridges/BlaguesDeMerdeBridge.php @@ -7,6 +7,10 @@ class BlaguesDeMerdeBridge extends BridgeAbstract { const CACHE_TIMEOUT = 7200; // 2h const DESCRIPTION = 'Blagues De Merde'; + public function getIcon() { + return self::URI . 'assets/img/favicon.ico'; + } + public function collectData(){ $html = getSimpleHTMLDOM(self::URI) @@ -39,5 +43,4 @@ class BlaguesDeMerdeBridge extends BridgeAbstract { } } - } diff --git a/bridges/BloombergBridge.php b/bridges/BloombergBridge.php index 8aff0ec7..9eb12191 100644 --- a/bridges/BloombergBridge.php +++ b/bridges/BloombergBridge.php @@ -31,6 +31,10 @@ class BloombergBridge extends BridgeAbstract return parent::getName(); } + public function getIcon() { + return 'https://assets.bwbx.io/s3/javelin/public/hub/images/favicon-black-63fe5249d3.png'; + } + public function collectData() { switch($this->queriedContext) { diff --git a/bridges/BundesbankBridge.php b/bridges/BundesbankBridge.php index 972290bd..d21f22b6 100644 --- a/bridges/BundesbankBridge.php +++ b/bridges/BundesbankBridge.php @@ -27,6 +27,10 @@ class BundesbankBridge extends BridgeAbstract { ) ); + public function getIcon() { + return self::URI . 'resource/crblob/1890/a7f48ee0ae35348748121770ba3ca009/mL/favicon-ico-data.ico'; + } + public function getURI() { switch($this->getInput(self::PARAM_LANG)) { case self::LANG_EN: return self::URI . 'en/publications/reports/studies'; @@ -79,5 +83,4 @@ class BundesbankBridge extends BridgeAbstract { } } - } diff --git a/bridges/CNETBridge.php b/bridges/CNETBridge.php index bd41febc..564b817a 100644 --- a/bridges/CNETBridge.php +++ b/bridges/CNETBridge.php @@ -52,9 +52,9 @@ class CNETBridge extends BridgeAbstract { returnClientError('Invalid topic: ' . $topic); // Retrieve webpage - $pageUrl = self::URI . (empty($topic) ? 'news/' : $topic.'/'); + $pageUrl = self::URI . (empty($topic) ? 'news/' : $topic . '/'); $html = getSimpleHTMLDOM($pageUrl) - or returnServerError('Could not request CNET: '.$pageUrl); + or returnServerError('Could not request CNET: ' . $pageUrl); // Process articles foreach($html->find('div.assetBody, div.riverPost') as $element) { diff --git a/bridges/ChristianDailyReporterBridge.php b/bridges/ChristianDailyReporterBridge.php index b8cbf3c8..85f664df 100644 --- a/bridges/ChristianDailyReporterBridge.php +++ b/bridges/ChristianDailyReporterBridge.php @@ -7,6 +7,9 @@ class ChristianDailyReporterBridge extends BridgeAbstract { const DESCRIPTION = 'The Unofficial Christian Daily Reporter RSS'; // const CACHE_TIMEOUT = 86400; // 1 day + public function getIcon() { + return self::URI . 'images/cdrfavicon.png'; + } public function collectData() { $uri = 'https://www.christiandailyreporter.com/'; diff --git a/bridges/CommonDreamsBridge.php b/bridges/CommonDreamsBridge.php index e4dcb63f..22b9238d 100644 --- a/bridges/CommonDreamsBridge.php +++ b/bridges/CommonDreamsBridge.php @@ -3,7 +3,7 @@ class CommonDreamsBridge extends FeedExpander { const MAINTAINER = 'nyutag'; const NAME = 'CommonDreams Bridge'; - const URI = 'http://www.commondreams.org/'; + const URI = 'https://www.commondreams.org/'; const DESCRIPTION = 'Returns the newest articles.'; public function collectData(){ diff --git a/bridges/ContainerLinuxReleasesBridge.php b/bridges/ContainerLinuxReleasesBridge.php index a82ba7e2..ae438885 100644 --- a/bridges/ContainerLinuxReleasesBridge.php +++ b/bridges/ContainerLinuxReleasesBridge.php @@ -32,6 +32,10 @@ class ContainerLinuxReleasesBridge extends BridgeAbstract { return json_decode($json, true); } + public function getIcon() { + return 'https://coreos.com/assets/ico/favicon.png'; + } + public function collectData() { $data = $this->getReleaseFeed($this->getJsonUri()); diff --git a/bridges/CrewbayBridge.php b/bridges/CrewbayBridge.php new file mode 100644 index 00000000..a3c52b9a --- /dev/null +++ b/bridges/CrewbayBridge.php @@ -0,0 +1,227 @@ + array( + 'name' => 'Filter by keyword', + 'title' => 'Enter the keyword to filter here' + ), + 'type' => array( + 'name' => 'Type of search', + 'title' => 'Choose between finding a boat or a crew', + 'type' => 'list', + 'values' => array( + 'Find a boat' => 'boats', + 'Find a crew' => 'crew' + ) + ), + 'status' => array( + 'name' => 'Status on the boat', + 'title' => 'Choose between recreational or professional classified ads', + 'type' => 'list', + 'values' => array( + 'Recreational' => 'recreational', + 'Professional' => 'professional' + ) + ), + 'recreational_position' => array( + 'name' => 'Recreational position wanted', + 'title' => 'Filter by recreational position you wanted aboard', + 'required' => false, + 'type' => 'list', + 'values' => array( + '' => '', + 'Amateur Crew' => 'Amateur Crew', + 'Friendship' => 'Friendship', + 'Competent Crew' => 'Competent Crew', + 'Racing' => 'Racing', + 'Voluntary work' => 'Voluntary work', + 'Mile building' => 'Mile building' + ) + ), + 'professional_position' => array( + 'name' => 'Professional position wanted', + 'title' => 'Filter by professional position you wanted aboard', + 'required' => false, + 'type' => 'list', + 'values' => array( + '' => '', + '1st Engineer' => '1st Engineer', + '1st Mate' => '1st Mate', + 'Beautician' => 'Beautician', + 'Bosun' => 'Bosun', + 'Captain' => 'Captain', + 'Chef' => 'Chef', + 'Steward(ess)' => 'Steward(ess)', + 'Deckhand' => 'Deckhand', + 'Delivery Crew' => 'Delivery Crew', + 'Dive Instructor' => 'Dive Instructor', + 'Masseur' => 'Masseur', + 'Medical Staff' => 'Medical Staff', + 'Nanny' => 'Nanny', + 'Navigator' => 'Navigator', + 'Racing Crew' => 'Racing Crew', + 'Teacher' => 'Teacher', + 'Electrical Engineer' => 'Electrical Engineer', + 'Fitter' => 'Fitter', + '2nd Engineer' => '2nd Engineer', + '3rd Engineer' => '3rd Engineer', + 'Lead Deckhand' => 'Lead Deckhand', + 'Security Officer' => 'Security Officer', + 'O.O.W' => 'O.O.W', + '1st Officer' => '1st Officer', + '2nd Officer' => '2nd Officer', + '3rd Officer' => '3rd Officer', + 'Captain/Engineer' => 'Captain/Engineer', + 'Hairdresser' => 'Hairdresser', + 'Fitness Trainer' => 'Fitness Trainer', + 'Laundry' => 'Laundry', + 'Solo Steward/ess' => 'Solo Steward/ess', + 'Stew/Deck' => 'Stew/Deck', + '2nd Steward/ess' => '2nd Steward/ess', + '3rd Steward/ess' => '3rd Steward/ess', + 'Chief Steward/ess' => 'Chief Steward/ess', + 'Head Housekeeper' => 'Head Housekeeper', + 'Purser' => 'Purser', + 'Cook' => 'Cook', + 'Cook/Stew' => 'Cook/Stew', + '2nd Chef' => '2nd Chef', + 'Head Chef' => 'Head Chef', + 'Administrator' => 'Administrator', + 'P.A' => 'P.A', + 'Villa staff' => 'Villa staff', + 'Housekeeping/Stew' => 'Housekeeping/Stew', + 'Stew/Beautician' => 'Stew/Beautician', + 'Stew/Masseuse' => 'Stew/Masseuse', + 'Manager' => 'Manager', + 'Sailing instructor' => 'Sailing instructor' + ) + ) + ) + ); + + public function collectData() { + $url = $this->getURI(); + $html = getSimpleHTMLDOM($url) or returnClientError('No results for this query.'); + + $annonces = $html->find('#SearchResults div.result'); + $limit = 0; + + foreach ($annonces as $annonce) { + $detail = $annonce->find('.btn--profile', 0); + $htmlDetail = getSimpleHTMLDOMCached($detail->href); + + if (!empty($this->getInput('recreational_position')) || !empty($this->getInput('professional_position'))) { + if ($this->getInput('type') == 'boats') { + if ($this->getInput('status') == 'professional') { + $positions = array($annonce->find('.title .position', 0)->plaintext); + } else { + $positions = array(str_replace('Wanted:', '', $annonce->find('.content li', 0)->plaintext)); + } + } else { + $list = $htmlDetail->find('.viewer-details .viewer-list'); + $positions = explode("\r\n", end($list)->find('span.value', 0)->plaintext); + } + + $found = false; + $keyword = $this->getInput('status') == 'professional' ? 'professional_position' : 'recreational_position'; + foreach ($positions as $position) { + if (strpos(trim($position), $this->getInput($keyword)) !== false) { + $found = true; + break; + } + } + + if (!$found) { + continue; + } + } + + $item = array(); + + if ($this->getInput('type') == 'boats') { + $titleSelector = '.title h2'; + } else { + $titleSelector = '.layout__item h2'; + } + $userName = $annonce->find('.result--description a', 0)->plaintext; + $annonceTitle = trim($annonce->find($titleSelector, 0)->plaintext); + if (empty($annonceTitle)) { + $item['title'] = $userName; + } else { + $item['title'] = $userName . ' - ' . $annonceTitle; + } + + $item['uri'] = $detail->href; + $images = $annonce->find('.avatar img'); + $item['enclosures'] = array(end($images)->getAttribute('src')); + + $content = $htmlDetail->find('.viewer-intro--info', 0)->innertext; + + $sections = $htmlDetail->find('.viewer-container .viewer-section'); + foreach ($sections as $section) { + if ($section->find('.viewer-section-title', 0)) { + $class = str_replace('viewer-', '', explode(' ', $section->getAttribute('class'))[0]); + if (!in_array($class, array('apply', 'photos', 'reviews', 'contact', 'experience', 'qa'))) { + // Basic sections + $content .= $section->find('.viewer-section-title h3', 0)->outertext; + $content .= $section->find('.viewer-section-content', 0)->innertext; + } + } else { + // Info section + $content .= $section->find('.viewer-section-content h3', 0)->outertext; + $content .= $section->find('.viewer-section-content p', 0)->outertext; + } + } + + if (!empty($this->getInput('keyword'))) { + $keyword = strtolower($this->getInput('keyword')); + if (strpos(strtolower($item['title']), $keyword) === false) { + if (strpos(strtolower($content), $keyword) === false) { + continue; + } + } + } + + $item['content'] = $content; + + $tags = $htmlDetail->find('li.viewer-tags--tag'); + foreach ($tags as $tag) { + if (!isset($item['categories'])) { + $item['categories'] = array(); + } + $text = trim($tag->plaintext); + if (!in_array($text, $item['categories'])) { + $item['categories'][] = $text; + } + } + + $this->items[] = $item; + $limit += 1; + + if ($limit == 10) break; + } + } + + public function getURI() { + $uri = parent::getURI(); + + if ($this->getInput('type') == 'boats') { + $uri .= '/boats'; + } else { + $uri .= '/crew'; + } + + if ($this->getInput('status') == 'professional') { + $uri .= '/professional'; + } else { + $uri .= '/recreational'; + } + + return $uri; + } +} diff --git a/bridges/DailymotionBridge.php b/bridges/DailymotionBridge.php index d075041c..ff8d4828 100644 --- a/bridges/DailymotionBridge.php +++ b/bridges/DailymotionBridge.php @@ -48,6 +48,10 @@ class DailymotionBridge extends BridgeAbstract { return $metadata; } + public function getIcon() { + return 'https://static1-ssl.dmcdn.net/images/neon/favicons/android-icon-36x36.png.vf806ca4ed0deed812'; + } + public function collectData(){ $html = ''; $limit = 5; diff --git a/bridges/DealabsBridge.php b/bridges/DealabsBridge.php index b9b05ed9..89183edb 100644 --- a/bridges/DealabsBridge.php +++ b/bridges/DealabsBridge.php @@ -15,27 +15,25 @@ class DealabsBridge extends PepperBridgeAbstract { 'hide_expired' => array( 'name' => 'Masquer les éléments expirés', 'type' => 'checkbox', - 'required' => 'true' + 'required' => true ), 'hide_local' => array( 'name' => 'Masquer les deals locaux', 'type' => 'checkbox', 'title' => 'Masquer les deals en magasins physiques', - 'required' => 'true' + 'required' => true ), 'priceFrom' => array( 'name' => 'Prix minimum', 'type' => 'text', 'title' => 'Prix mnimum en euros', - 'required' => 'false', - 'defaultValue' => '' + 'required' => false ), 'priceTo' => array( 'name' => 'Prix maximum', 'type' => 'text', 'title' => 'Prix maximum en euros', - 'required' => 'false', - 'defaultValue' => '' + 'required' => false ), ), @@ -43,7 +41,7 @@ class DealabsBridge extends PepperBridgeAbstract { 'group' => array( 'name' => 'Groupe', 'type' => 'list', - 'required' => 'true', + 'required' => true, 'title' => 'Groupe dont il faut afficher les deals', 'values' => array( 'Abonnements internet' => 'abonnements-internet', @@ -959,7 +957,7 @@ class DealabsBridge extends PepperBridgeAbstract { 'order' => array( 'name' => 'Trier par', 'type' => 'list', - 'required' => 'true', + 'required' => true, 'title' => 'Ordre de tri des deals', 'values' => array( 'Du deal le plus Hot au moins Hot' => '', @@ -1074,10 +1072,10 @@ class PepperBridgeAbstract extends BridgeAbstract { $url = $this->i8n('bridge-uri') . '/search/advanced?q=' . urlencode($q) - . '&hide_expired='. $hide_expired - . '&hide_local='. $hide_local - . '&priceFrom='. $priceFrom - . '&priceTo='. $priceTo + . '&hide_expired=' . $hide_expired + . '&hide_local=' . $hide_local + . '&priceFrom=' . $priceFrom + . '&priceTo=' . $priceTo /* Some default parameters * search_fields : Search in Titres & Descriptions & Codes * sort_by : Sort the search by new deals @@ -1152,30 +1150,30 @@ class PepperBridgeAbstract extends BridgeAbstract { foreach ($list as $deal) { $item = array(); $item['uri'] = $deal->find('div[class=threadGrid-title]', 0)->find('a', 0)->href; - $item['title'] = $deal->find('a[class*='. $selectorLink .']', 0 + $item['title'] = $deal->find('a[class*=' . $selectorLink . ']', 0 )->plaintext; $item['author'] = $deal->find('span.thread-username', 0)->plaintext; $item['content'] = '' - . $deal->find('a[class*='. $selectorLink .']', 0)->innertext + . $deal->find('a[class*=' . $selectorLink . ']', 0)->innertext . '' . $this->getPrice($deal) . $this->getDiscount($deal) . $this->getShipsFrom($deal) . $this->getShippingCost($deal) . $this->GetSource($deal) - . $deal->find('div[class*='. $selectorDescription .']', 0)->innertext + . $deal->find('div[class*=' . $selectorDescription . ']', 0)->innertext . ' | ' - . $deal->find('div[class*='. $selectorHot .']', 0) + . $deal->find('div[class*=' . $selectorHot . ']', 0) ->find('span', 1)->outertext . ' |
' // description + . $post->description + . '
Size: ' // image size
+ . $post->width
+ . 'x'
+ . $post->height
+ . '
Source: '
+ . $post->source_url
+ . '
' - . $result->find('div.card-price', 0)->plaintext + . $result->find('span.currency-value', 0)->plaintext . ' ' + . $result->find('span.currency-symbol', 0)->plaintext . '
' - . $result->find('div.card-title', 0)->plaintext + . $result->find('a', 0)->title . '
'; - $image = $result->find('img.placeholder', 0)->src; + $image = $result->find('img.display-block', 0)->src; if($this->getInput('showimage')) { $item['content'] .= ''; diff --git a/bridges/ExtremeDownloadBridge.php b/bridges/ExtremeDownloadBridge.php index eac27e36..52729971 100644 --- a/bridges/ExtremeDownloadBridge.php +++ b/bridges/ExtremeDownloadBridge.php @@ -15,7 +15,7 @@ class ExtremeDownloadBridge extends BridgeAbstract { 'filter' => array( 'name' => 'Type de contenu', 'type' => 'list', - 'required' => 'true', + 'required' => true, 'title' => 'Type de contenu à suivre : Téléchargement, Streaming ou les deux', 'values' => array( 'Streaming et Téléchargement' => 'both', @@ -100,5 +100,4 @@ class ExtremeDownloadBridge extends BridgeAbstract { return $return; } - } diff --git a/bridges/FB2Bridge.php b/bridges/FB2Bridge.php index cd4bb47f..29df7554 100644 --- a/bridges/FB2Bridge.php +++ b/bridges/FB2Bridge.php @@ -15,6 +15,10 @@ class FB2Bridge extends BridgeAbstract { ) )); + public function getIcon() { + return 'https://static.xx.fbcdn.net/rsrc.php/yo/r/iRmz9lCMBD2.ico'; + } + public function collectData(){ //Utility function for cleaning a Facebook link @@ -65,14 +69,14 @@ class FB2Bridge extends BridgeAbstract { if($this->getInput('u') !== null) { $page = 'https://touch.facebook.com/' . $this->getInput('u'); $cookies = $this->getCookies($page); - $pageID = $this->getPageID($page, $cookies); + $pageInfo = $this->getPageInfos($page, $cookies); - if($pageID === null) { + if($pageInfo['userId'] === null) { echo <<