aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbRegex.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-12-26 03:37:32 -0500
committerAllan Wang <me@allanwang.ca>2017-12-26 03:39:28 -0500
commit1769dbcef9786b847ffeaebdf6ecced45da9222c (patch)
tree50f543469607b608c0b62ca8a63c6a65325802b9 /app/src/main/kotlin/com/pitchedapps/frost/facebook/FbRegex.kt
parent8080d43dbd9a6863fadb86594b179d0919d6215b (diff)
downloadfrost-1769dbcef9786b847ffeaebdf6ecced45da9222c.tar.gz
frost-1769dbcef9786b847ffeaebdf6ecced45da9222c.tar.bz2
frost-1769dbcef9786b847ffeaebdf6ecced45da9222c.zip
Enhancement/fb requests (#575)v1.7.2
* Update lambdas to references * Simplify regex and parsers * Fix some parsing and add more tests * Improve message parser and tests * Simplify parser * Shorten interfaces * Push rem * Create notification parser * Clean up notification service * Clean up notification service * Add safe cookie fallback * Fix cookie reference * Make parsers only hold cookie string * Clean up cookie references * Fix up login and event theme * Update changelog Remove workspace backup
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/facebook/FbRegex.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/FbRegex.kt11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbRegex.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbRegex.kt
index 39e8c467..8d625582 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbRegex.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbRegex.kt
@@ -13,8 +13,17 @@ package com.pitchedapps.frost.facebook
* Matches the fb_dtsg component of a page containing it as a hidden value
*/
val FB_DTSG_MATCHER: Regex by lazy { Regex("name=\"fb_dtsg\" value=\"(.*?)\"") }
+val FB_REV_MATCHER: Regex by lazy{Regex("\"app_version\":\"(.*?)\"")}
/**
* Matches user id from cookie
*/
-val FB_USER_MATCHER: Regex by lazy { Regex("c_user=([0-9]*);") } \ No newline at end of file
+val FB_USER_MATCHER: Regex by lazy { Regex("c_user=([0-9]*);") }
+
+val FB_EPOCH_MATCHER: Regex by lazy { Regex(":([0-9]+)") }
+val FB_NOTIF_ID_MATCHER: Regex by lazy { Regex("notif_id\":([0-9]+)") }
+val FB_MESSAGE_NOTIF_ID_MATCHER: Regex by lazy { Regex("[thread|user]_fbid_([0-9]+)") }
+val FB_CSS_URL_MATCHER: Regex by lazy { Regex("url\\([\"|'](.*?)[\"|']\\)") }
+
+operator fun MatchResult?.get(groupIndex: Int) = this?.groupValues?.get(groupIndex)
+