Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
clean links (improvements) #89
Browse files Browse the repository at this point in the history
  • Loading branch information
indywidualny committed Feb 11, 2016
1 parent 5a8c467 commit 5a9f059
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions app/src/main/java/org/indywidualni/fblite/util/Offline.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,20 @@ public static String cleanUrl(String url) {
* remove ?refid=* it's always first and nothing is later
* remove ?hrc=* it's always first and nothing important is later
* remove &refsrc=* it's always last and nothing important is later
* remove ?fref=* it's always last and nothing important is later
* remove ?ref=* it's always last and nothing important is later
* remove &ref=* it's always last and nothing important is later
* remove ?ref_type=* it's always last and nothing important is later
* remove &ref_type=* it's always last and nothing important is later (just in case)
* remove home.php it's always first and nothing is later (main page)
* replace mobile. to m.
* remove ?_rdr it's always last and nothing is later
* remove &_rdr it's always last and nothing is later
* remove / it's always last and nothing is later
*/
url = url.replaceAll("\\?refid=.*", "").replaceAll("\\?hrc=.*", "").replaceAll("&refsrc=.*", "");
*/
url = url.replaceAll("\\?refid=.*", "").replaceAll("\\?hrc=.*", "").replaceAll("&refsrc=.*", "")
.replaceAll("\\?fref=.*", "").replaceAll("\\?ref=.*", "").replaceAll("&ref=.*", "")
.replaceAll("\\?ref_type=.*", "").replaceAll("&ref_type=.*", "");
url = url.replace("home.php", "").replace("mobile.", "m.").replace("?_rdr", "").replace("&_rdr", "");
return removeEndingSlash(url);
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
<string name="offline_keep_max">Max liczba stron do przechowania</string>
<string name="offline_keep_max_description">Gdy online odwiedzone strony są zapisywane w bazie danych. Domyślnie (najnowsze) 10 stron.</string>
<string name="offline_dummy_description">Kod źródłowy bieżącej strony jest asynchronicznie zapisywany w bazie danych. W przypadku duplikatu zachowam najnowszą wersję. Odśwież by wymusić aktualizację. Nie działa dla dynamicznych treści.</string>
<string name="keyboard_fix">Napraw niewidoczne formularze &#8635;</string>
<string name="keyboard_fix">Napraw zasłonięte formularze &#8635;</string>
<string name="offline_database_empty">Baza danych jest pusta</string>

</resources>

0 comments on commit 5a9f059

Please sign in to comment.