aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/main.go b/main.go
index 1b93d8d..402ec8f 100644
--- a/main.go
+++ b/main.go
@@ -105,7 +105,16 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/favicon.ico" {
return
}
+
+ if r.URL.Path == "/" {
+ http.Error(w, fmt.Sprintf("usage: %s/@facebookGroupName", r.Host), 400)
+ return
+ }
+
group := r.URL.Path[1:]
+ if group[0] == '@' {
+ group = group[1:]
+ }
if strings.HasSuffix(group, ".rss") {
group = strings.TrimSuffix(group, ".rss")
outputMode = "rss"
@@ -121,7 +130,7 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
if c == nil || len(c.Items) < 1 {
- http.Error(w, fmt.Sprintf("%s", "group not found"), 400)
+ http.Error(w, fmt.Sprintf("%s", "Group not found."), 400)
return
}