Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BridgeXPathAbstract + BlizzardNewsBridge + XPathBridge] Add new abstract class + two example implementations #1671

Merged
merged 8 commits into from
Nov 8, 2020

Conversation

Niehztog
Copy link
Contributor

@Niehztog Niehztog commented Aug 1, 2020

As a reaction to the discussion in my original pull request, where user @somini suggested to provide an abstract bridge simplifying the creation of new bridges using xpath expressions, I developed this new proposal as a pull request.
Basically I divided the code of my original pull request into three different classes: One abstract class "BridgeXPathAbstract" and two derived classes "BlizzardNewsBridge" and "XPathBridge" demonstrating how to use it. This approach has two great advantages:

  • other bridge developers can make use of the xpath functions more easily, shortening time required to develop and update bridges
  • user defined xpath expressions for parsing new sites into feeds can easily be stored in a new bridge file which can be shared with the whole community

Contents:

  • BridgeXPathAbstract is a new base class for making development of new bridges more easy.
  • BlizzardNewsBridge is an example implementation which covers news feed of game company blizzard in multiple languages.
  • XPathBridge is an example implementation which allows entering any user defined xpath expressions into form input fields (great flexibility).

This PR can be regarded as an alternative approach to 1645.
If desired I would be totaly okay with removing XPathBridge from the PR. I left it here for quick debugging of new xpath expressions without the need to create a new bridge class.

@Niehztog Niehztog force-pushed the abstract_xpath_bridge branch 7 times, most recently from 56534ff to b731162 Compare August 2, 2020 14:06
Copy link
Contributor

@em92 em92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, @Niehztog !
Here are some comments. I will add more later

bridges/BlizzardNewsBridge.php Outdated Show resolved Hide resolved
lib/BridgeXPathAbstract.php Outdated Show resolved Hide resolved
lib/BridgeXPathAbstract.php Outdated Show resolved Hide resolved
lib/BridgeXPathAbstract.php Outdated Show resolved Hide resolved
@em92
Copy link
Contributor

em92 commented Aug 3, 2020

Also, you don't need to rebase and force push. You commits will be squashed after merging.

@Niehztog Niehztog force-pushed the abstract_xpath_bridge branch from b731162 to 782b1c0 Compare August 10, 2020 21:37
@Niehztog
Copy link
Contributor Author

Hello @em92
thank you very much for your kind and helpful feedback and your explanation about rebasing/force-pushing. I added a second commit implementing most of your suggestions. If you have more, they'd be welcome.

@Niehztog Niehztog force-pushed the abstract_xpath_bridge branch from 782b1c0 to baa55a7 Compare August 25, 2020 21:15
@em92
Copy link
Contributor

em92 commented Oct 31, 2020

Hi, @Niehztog ! Could you please rebase your PR? In mid october I have fixed Travis CI for automatic PR checks. It stopped working in August.

@Niehztog Niehztog force-pushed the abstract_xpath_bridge branch from 895f4a8 to c6da4da Compare October 31, 2020 19:59
@Niehztog
Copy link
Contributor Author

Hi, @Niehztog ! Could you please rebase your PR? In mid october I have fixed Travis CI for automatic PR checks. It stopped working in August.

Hi @em92 , thank your for looking into here! I just rebased this PR. Hopefully it looks fine now.

@em92 em92 merged commit 3ad1380 into RSS-Bridge:master Nov 8, 2020
@em92
Copy link
Contributor

em92 commented Nov 8, 2020

gj @Niehztog

@Niehztog Niehztog deleted the abstract_xpath_bridge branch November 8, 2020 19:21
*/
protected function fixEncoding($input)
{
return $this->getParam('fix_encoding') ? utf8_decode($input) : $input;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be utf8_encode() which would convert iso-8859 to utf8. Right now it's the other way around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants