Skip to content

Commit

Permalink
feat: add ebay articles
Browse files Browse the repository at this point in the history
  • Loading branch information
stroebjo committed Aug 22, 2018
1 parent 8746e3f commit dda90d7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
22 changes: 22 additions & 0 deletions Cleaner/Ebay.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

class Ebay implements URLCleaner
{

public function isApplicable($host)
{
return preg_match('/(www\.)?ebay\.([a-z]{2,3})/i', $host);
}

public function getShortURL($url_parts)
{
if (preg_match('/(itm)\/(.+)\/([0-9]+)/i', $url_parts['path'], $m)) {
$shorter_url = $url_parts['scheme'].'://'.$url_parts['host'].'/itm/'.$m[3];
return $shorter_url;
}

return null;

}

}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Currently supported are:
- Heise news articles
- reddit threads
- YoutTube videos
- ebay articles

Add new URL
-----------
Expand Down
4 changes: 3 additions & 1 deletion info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ Currently supported are:
- Heise news articles
- reddit threads
- YoutTube videos
- ebay articles
Add new URL
-----------
Expand Down Expand Up @@ -248,7 +250,7 @@ If you have a URL that is not currently supported, please create a pull request
</dict>
</dict>
<key>version</key>
<string>1.0.0</string>
<string>1.1.0</string>
<key>webaddress</key>
<string>http://jonathanstroebele.de</string>
</dict>
Expand Down

0 comments on commit dda90d7

Please sign in to comment.