Commit graph

23 commits

Author SHA1 Message Date
logmanoriginal
970e216c1f Merge branch 'methods2functions' of https://framagit.org/peetah/rss-bridge 2016-10-02 16:05:58 +02:00
Pierre Mazière
f1fb95b257 [core] extract BridgeAbstract methods to make them functions
- returnError, returnServerError, returnClientError ,debugMessage are
  moved to lib/error.php

- getContents, getSimpleHTMLDOM, getSimpleHTMLDOMCached are moved to
  lib/contents.php

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-09-25 23:22:33 +02:00
Pierre Mazière
235c985901 [BridgeAbstract] replace getCacheDuration method by CACHE_TIMEOUT class constant
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-09-25 17:04:28 +02:00
Pierre Mazière
9a0da733ef [bridges] use constants instead of variable members
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-09-01 23:15:51 +02:00
Pierre Mazière
342de7744b [ElsevierBridge] code simplification
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-28 14:15:38 +02:00
Pierre Mazière
1b3c8a8aeb [core + bridges] add BridgeAbstract::$inputs and BridgeAbstract::getInput()
Inputs are not stored in BridgeAbstract::$parameters anymore to separate
static data from dynamic data.
The getInput method allows for more readable code.

Also fix an "undefined index 'global'" notice

Probability of breaking bridges: high !

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-28 13:05:03 +02:00
Pierre Mazière
de1b39c8e5 [core + bridges] get rid of loadMetadata
if a bridge needs to modify some of the data that were initialized
there, ::__construct() should be used instead.

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-28 13:05:03 +02:00
Pierre Mazière
117031bf0f [core] store parameters values in BridgeAbstract::parameters
This way, any BridgeAbstract method can now have access to these values,
no only collectData

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-25 01:24:53 +02:00
logmanoriginal
bf0a9d754e [bridges] Change all occurrences of the Item object to array 2016-08-22 18:55:59 +02:00
Pierre Mazière
f0e502ce37 [bridges] migrate all bridges to an array based definition of parameters
see github issue 356

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-22 01:25:56 +02:00
Pierre Mazière
bba216073c [bridges] remove useless 'update' property from all bridges
That's the source code manager job to keep this information
consistent

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-21 00:21:41 +02:00
Pierre Mazière
490c5094f5 [ElsevierBridge] fix time extraction
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-19 18:50:50 +02:00
Pierre Mazière
3c0d13c1bb bridges: use BridgeAbstract::getSimpleHTMLDOM
instead of BridgeAbstract::file_get_html

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-19 10:20:27 +02:00
logmanoriginal
74f0572d91 bridges: Replace returnError function with more specific
Replacements depend on original error code:
400: returnClientError
404: returnServerError
500: returnServerError
501: returnServerError
2016-08-17 14:45:08 +02:00
logmanoriginal
fa59a25229 bridges: Update bridges with 'required' attributes 2016-08-15 01:19:16 +02:00
logmanoriginal
63bb7ef24d bridges: Remove unnecessary functions getName() and getURI() 2016-08-09 20:08:46 +02:00
logmanoriginal
e329a4c1b6 bridges: Change ->name to ->author 2016-08-09 14:54:44 +02:00
logmanoriginal
1d53b70272 bridges: Remove unused functions and update scopes
Many bridges implemented getDescription() which is only applicable for
bridges extending RSSExpander.

Functions that are not part of the abstract class or interface should
be in private scope for better readability.
2016-08-06 16:00:56 +02:00
logmanoriginal
a1c680f8e8 Fix indentation and improve code style
- Use tab instead of spaces
- Remove obsolete bridge description at start of the file
- Add spaces at the assignment operator ('=' -> ' = ')
- Remove unnecessary empty lines
2016-08-02 21:40:22 +02:00
logmanoriginal
f783969721 Create member functions to extract information from articles
The extractor function will handle many situations more specifically in
order to provide better results.
2016-08-02 21:35:13 +02:00
logmanoriginal
399fce06ce Require input field, add example value and title
Previously the bridge could be requested without any journal causing
error 403 due to broken URL.
2016-08-02 20:35:27 +02:00
logmanoriginal
8f76eebddb Fix parameters list
Fixes warning: "array_key_exists() expects parameter 2 to be array,
string given in /volume1/web/rss-bridge_dev/lib/HTMLUtils.php on line 59
Warning: Invalid argument supplied for foreach() in
/volume1/web/rss-bridge_dev/lib/HTMLUtils.php on line 64
2016-08-02 20:29:40 +02:00
Pierre Mazière
d45c6be3c5 add new bridge: Elsevier journals recent articles
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-06-26 11:52:54 +02:00