Build a plugin

Awarded Posted 7 years ago Paid on delivery
Awarded Paid on delivery

This project uses TinyTiny RSS ([login to view URL]) a web-based RSS server. Traditionally I have populated this application using Google search results fed in through RSS. Google have changed their RSS output. Articles that were once simply:

[login to view URL]

are now embedded with a prefix of:

[login to view URL]

and a postfix beginning:

&ct=

So the original link, shown above, now comes into TinyTiny RSS as:

[login to view URL]://www.weeklystandard.com/kristol-ryan-doesnt-think-trump-should-be-president/article/2003675&ct=ga&cd=CAIyGWNkNDE3MmEwYWFjZmE1ZGM6aWU6ZW46SUU&usg=AFQjCNFalMe6tTviyDgHgyzFAN4Vou-eYg

There is an existing plugin for TinyTiny RSS called ff_feedcleaner which allows regular expressions (regex) to be applied. I have tried this option populating its fields:

[

{

"URL_re" : "#www\\.google\\.ie#", //IE domain because this is RSS URL

"type" : "regex",

"pattern": "/http\\S+url=|&ct\\S+/",

"replacement": ""

}

]

The pipe "|" (or) character does not work when used with ff_feedcleaner. The prefix is removed but the postfix is not. An apparently obvious solution is to split the regex into two regexes. This has been tested, but it does not work. The first is applied, but the second is not.

I have described all of this in [login to view URL] One reply suggested:

**** Forum Comment - Begins ****

I'm guessing it's because you're using an OR operator (the vertical bar, |). The preg function is not internally recursive so it matches the first half and that's it. If the first half was missing, it would strip the second half. Anyway, this is really the wrong approach, as has been mentioned, just use the parse_url/parse_str functions and be done with it.

Code: Select all

function get_url_query_string_value( $link ) {

$qs = parse_url( $link, PHP_URL_QUERY );

if ( $qs ) {

$parts = array();

parse_str( $qs, $parts );

if ( array_key_exists( 'url', $parts ) && filter_var( $parts['url'], FILTER_VALIDATE_URL ) )

return $parts['url'];

}

return $link;

}

**** Forum Comment - Ends ****

Code above is untested, but should be complete enough to do what you want if you wrap it in the plugin class.

There are two options. Either create a new plugin or modify the existing one so that it removes the prefix and postfix for any google domains (.ie,. com, etc.). The code for ff_feedcleaner is located at [login to view URL] You may need to create an account to view it.

I can provide access to my installation of TinyTiny RSS so that the developer can test.

Please do not ask about getting payment upfront. I am content to pay for the project, otherwise I wouldn't be posting it here. I am content to lodge funds with Freelancer.com and to release those funds when the job is done.

PHP Software Architecture

Project ID: #11198013

About the project

7 proposals Remote project Active 7 years ago

7 freelancers are bidding on average €243 for this job

Dilipjaipur

Hello, I have ranking in top 5000 on freelancer.com and I hope it will give you an idea about my work quality and dedication to work. You will be safe while working with me. I have dedicated in house team for Wo More

€155 EUR in 3 days
(10 Reviews)
4.8