-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10c22b2
commit ae8043a
Showing
13 changed files
with
193 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
## Version 1.2.0 | ||
|
||
_2022-10-01_ | ||
|
||
- Add eBay sanitizer | ||
|
||
## Version 1.1.0 | ||
|
||
_2022-09-18_ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
- Reiniger für YouTube-Weiterleitungslinks hinzugefügt | ||
- Reiniger für Amazon-Seiten, die keine Produktseiten sind, hinzugefügt | ||
- Reiniger für Youtu.be Kurz-URLs hinzugefügt | ||
- Die App kann als Browser registriert werden | ||
- eBay Reiniger hinzugefügt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
- Add sanitizer for YouTube redirection links | ||
- Add sanitizer for Amazon non-product pages | ||
- Add Youtu.be short URL sanitizer | ||
- Add feature to register app as a browser | ||
- Add eBay sanitizer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Léon - The URL Cleaner | ||
* Copyright (C) 2022 Sven Jacobs | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
plugins { | ||
`feature-sanitizer` | ||
} | ||
|
||
android { | ||
namespace = "com.svenjacobs.app.leon.feature.sanitizer.ebay" | ||
resourcePrefix("feat_sanitizer_ebay_") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?><!-- | ||
~ Léon - The URL Cleaner | ||
~ Copyright (C) 2022 Sven Jacobs | ||
~ | ||
~ This program is free software: you can redistribute it and/or modify | ||
~ it under the terms of the GNU General Public License as published by | ||
~ the Free Software Foundation, either version 3 of the License, or | ||
~ (at your option) any later version. | ||
~ | ||
~ This program is distributed in the hope that it will be useful, | ||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
~ GNU General Public License for more details. | ||
~ | ||
~ You should have received a copy of the GNU General Public License | ||
~ along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
--> | ||
|
||
<manifest /> |
26 changes: 26 additions & 0 deletions
26
...izer-ebay/src/main/kotlin/com/svenjacobs/app/leon/feature/sanitizer/ebay/EbaySanitizer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Léon - The URL Cleaner | ||
* Copyright (C) 2022 Sven Jacobs | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.svenjacobs.app.leon.feature.sanitizer.ebay | ||
|
||
import com.svenjacobs.app.leon.core.common.regex.RegexFactory | ||
import com.svenjacobs.app.leon.core.domain.sanitizer.RegexSanitizer | ||
|
||
class EbaySanitizer : RegexSanitizer( | ||
regex = RegexFactory.AllParameters, | ||
) |
44 changes: 44 additions & 0 deletions
44
...c/main/kotlin/com/svenjacobs/app/leon/feature/sanitizer/ebay/EbaySanitizerRegistration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Léon - The URL Cleaner | ||
* Copyright (C) 2022 Sven Jacobs | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.svenjacobs.app.leon.feature.sanitizer.ebay | ||
|
||
import android.content.Context | ||
import com.svenjacobs.app.leon.core.domain.sanitizer.Sanitizer | ||
import com.svenjacobs.app.leon.core.domain.sanitizer.SanitizerId | ||
import com.svenjacobs.app.leon.core.domain.sanitizer.SanitizerRegistration | ||
|
||
class EbaySanitizerRegistration( | ||
private val sanitizerProvider: () -> EbaySanitizer = { EbaySanitizer() }, | ||
) : SanitizerRegistration { | ||
|
||
override val sanitizer: Sanitizer | ||
get() = sanitizerProvider() | ||
|
||
override val id = SanitizerId("ebay") | ||
|
||
override val hasSettingsScreen = false | ||
|
||
override fun getName(context: Context) = context.getString(R.string.feat_sanitizer_ebay_name) | ||
|
||
override fun matchesDomain(input: String) = DOMAIN_REGEX.containsMatchIn(input) | ||
|
||
private companion object { | ||
private val DOMAIN_REGEX = Regex("ebay\\..+/itm/") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?><!-- | ||
~ Léon - The URL Cleaner | ||
~ Copyright (C) 2022 Sven Jacobs | ||
~ | ||
~ This program is free software: you can redistribute it and/or modify | ||
~ it under the terms of the GNU General Public License as published by | ||
~ the Free Software Foundation, either version 3 of the License, or | ||
~ (at your option) any later version. | ||
~ | ||
~ This program is distributed in the hope that it will be useful, | ||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
~ GNU General Public License for more details. | ||
~ | ||
~ You should have received a copy of the GNU General Public License | ||
~ along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
--> | ||
|
||
<resources> | ||
<string name="feat_sanitizer_ebay_name" translatable="false">eBay</string> | ||
</resources> |
42 changes: 42 additions & 0 deletions
42
...bay/src/test/kotlin/com/svenjacobs/app/leon/feature/sanitizer/amazon/EbaySanitizerTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Léon - The URL Cleaner | ||
* Copyright (C) 2022 Sven Jacobs | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.svenjacobs.app.leon.feature.sanitizer.amazon | ||
|
||
import com.svenjacobs.app.leon.feature.sanitizer.ebay.EbaySanitizer | ||
import io.kotest.core.spec.style.WordSpec | ||
import io.kotest.matchers.shouldBe | ||
|
||
class EbaySanitizerTest : WordSpec( | ||
{ | ||
|
||
"invoke" should { | ||
|
||
"remove all parameters from eBay article URL" { | ||
val sanitizer = EbaySanitizer() | ||
val result = sanitizer( | ||
"https://www.ebay.de/itm/271784973135?mkcid=16&mkevt=1&mkrid=707-127654" + | ||
"-2357-0&ssspo=rMbbkKXARCW&sssrc=2348624&ssuid=Bw-3_LUXSsm&widget_ver=art" + | ||
"emis&media=MORE", | ||
) | ||
|
||
result shouldBe "https://www.ebay.de/itm/271784973135" | ||
} | ||
} | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters