Commit graph

126 commits

Author SHA1 Message Date
logmanoriginal
5ad1fa8242 Merge branch 'constantine' of https://framagit.org/peetah/rss-bridge 2016-09-02 17:36:51 +02:00
Pierre Mazière
556b8a2452 [core] transform some BridgeAbstract members to class constants
This concerns $uri, $name, $maintainer, $parameters and $description

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-09-01 23:12:51 +02:00
Pierre Mazière
729cbadc77 [Bridge] fix input parameter value storage
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-09-01 23:12:30 +02:00
logmanoriginal
1aa01a1f67 [Bridge] Fix invalid text value without pattern 2016-09-01 21:07:27 +02:00
logmanoriginal
47b6cb8937 [Bridge] Return name of the parameter that failed the check 2016-09-01 20:59:49 +02:00
logmanoriginal
7c36b51aa2 [Bridge] Move code into functions 2016-09-01 20:53:47 +02:00
logmanoriginal
cd9435b936 [Bridge] Simplify cache loading 2016-09-01 19:43:25 +02:00
logmanoriginal
a84016bcb6 [core] Rename item getter/setter
getDatas -> getItems
setDatas -> setItems

Note: Bridge->setDatas actually sets data, where Bridge->getItems
only returns items (this is why Bridge->setDatas was not changed)
2016-08-29 19:42:58 +02:00
Pierre Mazière
b1a834801b [BridgeAbstract] fix empty parameter context
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-29 13:27:30 +02:00
logmanoriginal
8ed3b02899 Merge branch 'core' of http://framagit.org/peetah/rss-bridge 2016-08-28 20:33:27 +02:00
logmanoriginal
e4b314f78a [Bridge] Enable cache file deletion 2016-08-28 19:50:33 +02:00
logmanoriginal
5f3d28f3a6 [Bridge] Return HTML DOM with get_cached 2016-08-28 19:37:32 +02:00
Pierre Mazière
fb05976fa6 [core] fix two-levels list default value support
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-28 13:05:03 +02:00
Pierre Mazière
74d876b585 [core] add explicit support for list default value
and implicit support for text and number parameters

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-28 13:05:03 +02:00
Pierre Mazière
93634ada3a [core] really fix bridges without parameters
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-28 13:05:03 +02:00
Pierre Mazière
16dc7fcb6f [core] fix bridges without parameters
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-28 13:05:03 +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
2047955f06 [core] rename $param to $inputs
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-28 13:05:03 +02:00
Pierre Mazière
d1715f6efc [core] fix missing curly brackets
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-28 13:05:03 +02:00
Pierre Mazière
85625318b1 [core] variable renaming
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-28 13:05:03 +02:00
Pierre Mazière
ea1d53a24a [core] fix global parameter values propagatino
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-28 13:05:03 +02:00
Pierre Mazière
701aff420d [core] code simplification
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
7857325d9c [core] set checkboxes default value to false
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-28 13:00:55 +02:00
Pierre Mazière
3f36ca2a9b [core] unexpected input generates a fail
because paranoïa is the way to security !
Should this be optional ?

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-25 17:52:44 +02:00
Pierre Mazière
a67a219bf9 [core] remove '$param' argument from RssExpander::collectExpandableDatas
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-25 17:11:49 +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
Pierre Mazière
dea37c8e34 [core] use BridgeAbstract::parameters to sanitize inputs
This should result in a lot of simplifications in the bridges
since data validation is now done upstream.

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-25 01:20:12 +02:00
logmanoriginal
1d0b8f20f3 [Bridge] Fix missing function scope 2016-08-24 20:50:32 +02:00
logmanoriginal
95404b8fc4 [Bridge] Move 'Bridge' class at top of the file 2016-08-24 20:48:12 +02:00
logmanoriginal
b9b2428f63 [Bridge] Add function to build chache file path 2016-08-24 20:44:21 +02:00
logmanoriginal
458d1fbfeb [Bridge] Rename to 2016-08-24 20:35:19 +02:00
logmanoriginal
56cb116ce6 [Bridge] Format unreadable lines longer than 80 chars 2016-08-24 20:31:39 +02:00
logmanoriginal
8252387386 [Bridge] Rename 'message' to 'debugMessage' 2016-08-24 20:18:59 +02:00
logmanoriginal
9021a4b7cc [Bridge] Don't return object instance with 'setCache' 2016-08-24 20:17:26 +02:00
logmanoriginal
429126e18a [Bridge] Cleanup file
- Remove unnecessary documentation
- Update/Clarify documentation where necessary
- Remove empty lines
- Put 'else' between closing and opening curly braces
- Make sure curly braces start right after closing brace on functions '(){...'
- Start lines with '.' and use proper indentation when using multi-line string combinations
- Add spaces for function definitions/calls and assignments
- Add space before opening curly brace after class definition 'class xyz {'
2016-08-24 20:14:23 +02:00
logmanoriginal
a43703d32d [Bridge] Replace double quotes with single quotes
This harmonizes the usage throughout the file.
2016-08-24 19:33:38 +02:00
logmanoriginal
07f664b2fa [Bridge] Remove duplicate definition of member variables 2016-08-24 18:32:31 +02:00
logmanoriginal
c0c4759cde [Bridge] Enable all calls to message($)
The 'message' function will only execute in debug mode, so
no harm done if left active.
2016-08-24 18:19:44 +02:00
logmanoriginal
d80efed1f4 [Bridge] Use space indentation everywhere 2016-08-24 18:09:34 +02:00
Pierre Mazière
581bff166c [core] makes 'bridge' and 'format' parameters value less verbose
remove the requirement for 'Format' and 'Bridge' suffixes:
https://example.com/?action=display&bridge=Twitter&format=Atom&u=user

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-23 14:34:07 +02:00
Pierre Mazière
b3af604cc1 [core] remove useless static methods
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-23 13:44:23 +02:00
Pierre Mazière
86515a1560 core: use proxy when defined in RssExpander
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-19 10:20:27 +02:00
Pierre Mazière
226484ba22 core: remove useless HttpCachingBridgeAbstract::download_remote()
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-19 10:20:27 +02:00
Pierre Mazière
fe58d23c17 core: use proxy when defined in HttpCachingBridgeAbstract
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-19 10:20:27 +02:00
Pierre Mazière
d74beb6c6a core: move message() method to parent class BridgeAbstract
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-19 10:20:27 +02:00
Pierre Mazière
f43bbda83e core: split and rename BridgeAbstract::file_get_html
We need to have one method to get the data, potentially
using the proxy if defined, and one method to get the Simple
DOM HTML object from these data, with a more informative name

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-19 10:19:56 +02:00
Pierre Mazière
d71674d2ba proxy settings must be the service provider decision
therefore, the provider decides if the service use a
proxy or not, and if users can have the possibility to
disable it on a bridge basis.

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-19 10:19:56 +02:00
Pierre Mazière
3dd63ab6fd enable proxy usage for individual bridge
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-19 10:19:56 +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
73a1bcf3d6 [Bridge] Add specialized error handling functions 2016-08-17 13:58:55 +02:00
Mitsukarenai
5212b91cca [whitelist] trim content for wildcard (contrib: @Piokaz) 2016-08-16 00:00:33 +02:00
logmanoriginal
d3cbf38eb1 [Bridge] Allow '*' wildcard to whitelist all bridges
For this to work the whitelist.txt must only contain '*' (no \n)
2016-08-15 08:46:04 +02:00
logmanoriginal
7d073b3e96 [lib/Bridge] Remove loadMetadatas from BridgeAbstract
This method MUST be implemented by the bridges.
2016-08-06 19:02:02 +02:00
logmanoriginal
b59915f23b [lib/Bridge] Define default behavior for getName() and getURI()
Bridges no longer require implementation for getName() and getURI()
as they are now implemented with default behavior in BridgeAbstract.

This was previously implemented only for RSSExpander and is now part
of BridgeAbstract (automatically inherited).

Documentation is updated accordingly.
2016-08-06 18:21:43 +02:00
logmanoriginal
e6bd815bcc [lib/Bridge] Fix typo
This fixes "Notice: Undefined variable: defaultBRtext in
C:\xampp\htdocs\rss-bridge_dev\lib\Bridge.php on line 114"
2016-08-05 11:27:47 +02:00
Pierre Mazière
36d39d3f59 implement proxy feature without modifying simple_html_dom code
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-06-25 23:14:27 +02:00
Teromene
1a4a428449 Correction de quelques problèmes avec RSSExpander suite à la migration dans lib/Bridge.
Correction de typos.
Ajout de la possibilité d'utiliser un proxy.
2015-12-06 15:56:39 +01:00
Teromene
e582c887fb Ajout du paramètre pattern pour les entrées de type texte, ajout du required côté HTML.
Correction de la page d'accueuil pour qu'elle soit conforme aux standards du W3C.
Correction de la regex de listage des fichiers pour qu'elle ignore les sauvegardes.
Ajout d'un nettoyeur HTML, par défaut.
2015-12-06 15:56:39 +01:00
teromene
38829e7739 Little refactoring to reduce logic on index.php.
Moved RssExpander as a core logic system to lib/Bridge.php

Signed-off-by: teromene <teromene@teromene.fr>
2015-12-06 15:56:39 +01:00
teromene
715ad3bf3f Checking if the parameter mode has a name, same for exampleValue.
Change the default bridge name.

Signed-off-by: teromene <teromene@teromene.fr>
2015-12-06 15:56:39 +01:00
teromene
2d526f4e0a Correction de quelques bugs dans les bridges, qui apparaissent à cause du fait qu'ils sont tous instanciés lors du chargement de tout les bridges.
Ré-ajout et ré-utilisation de getName et getURI, qui permettent d'avoir des élements dynamiques.
Changement en public de certaines valeurs.
Changement du nom de certaines constantes, déja utilisés.

Signed-off-by: teromene <teromene@teromene.fr>
2015-12-06 15:56:39 +01:00
teromene
5d2e7ac83d Ajout d'options multiples pour les méta-données.
Ajout d'un bridge de démonstration, DemoBridge.
Ajout d'un début de documentation pour créer un bridge dans CREATE_BRIDGE.md
2015-12-06 15:56:39 +01:00
teromene
2deef45867 Première version du nouveau système de méta-données.
Voir exemple dans YoutubeBridge.
2015-12-06 15:56:39 +01:00
teromene
81f89b1246 Ajout de la possibilité d'avoir une liste en paramètre, voir exemple d'utilisation dans DauphineLibereBridge. 2015-09-14 13:59:20 +01:00
Kevin Lagaisse
de16ba234e Ajout de la date de publication en utilisant la date de dernière modification du cache 2015-05-20 21:47:58 +02:00
unknown
0f6fdb0c5b Merge branch 'live' 2015-04-06 14:54:54 +02:00
unknown
a5f52b8789 Merge remote-tracking branch 'upstream/master'
Conflicts:
	bridges/Sexactu.php
2015-04-06 14:52:04 +02:00
Mitsukarenai
614cde79a0 quick fix; prepare homepage param 2014-05-25 23:23:52 +02:00
Mitsukarenai
6956468b64 Add bridge info: maintainer 2014-05-21 19:09:37 +02:00
Nicolas Delsaux
fd71ceae82 Adding a meta-bridge for all Gawker publications (lifehacker, kotaku, you name it, ...) 2014-04-02 10:55:42 +01:00
Nicolas Delsaux
0fa32c7cf9 added a simple method to allow all subclasses to easily relocate image links 2014-03-26 16:04:10 +01:00
Nicolas Delsaux
954bc4dde0 Improved caching behaviour and allowed subclasses to easily use logging 'infrastructure' 2014-03-26 11:20:24 +01:00
Riduidel
f2f82c7d03 Prepared Gawker bridge by extracting file cache from initial Liberation bridge 2014-03-03 14:12:24 +01:00
Nicolas Delsaux
5f150d3ae5 Outputting path to expected bridge should help newcomers feeling welcomed, no ? 2014-02-18 11:58:29 +01:00
Yves ASTIER
927b04dfef Refonte du code 2013-08-11 13:30:41 +02:00