summaryrefslogtreecommitdiff
path: root/helper.go
diff options
context:
space:
mode:
authorhorus2020-04-02 21:53:30 +0200
committerhorus2020-04-02 21:53:30 +0200
commit0b90b7a3b0f38f0babf4d788f4d7dd5e43253341 (patch)
treea5492cf5246522a5dd0e201be3ae988ae7e6245c /helper.go
downloadcurious-crawler-0b90b7a3b0f38f0babf4d788f4d7dd5e43253341.tar.gz
Initial commit.
Diffstat (limited to 'helper.go')
-rw-r--r--helper.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/helper.go b/helper.go
new file mode 100644
index 0000000..649c2d4
--- /dev/null
+++ b/helper.go
@@ -0,0 +1,15 @@
+package main
+
+import (
+ "strings"
+)
+
+func stripHNPrefix(title string) string {
+ title = strings.TrimPrefix(title, "Ask HN:")
+ title = strings.TrimPrefix(title, "Show HN:")
+ title = strings.TrimPrefix(title, "Tell HN:")
+ title = strings.TrimPrefix(title, "Experiment HN:")
+ title = strings.TrimPrefix(title, "Launch HN:")
+
+ return strings.TrimSpace(title)
+}