about summary refs log tree commit diff stats
path: root/cache
diff options
context:
space:
mode:
Diffstat (limited to 'cache')
-rw-r--r--cache/index.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/cache/index.go b/cache/index.go
index 641e6dc..0cf8065 100644
--- a/cache/index.go
+++ b/cache/index.go
@@ -2,6 +2,7 @@ package cache
 
 import (
 	"log"
+	"strings"
 	"time"
 )
 
@@ -27,3 +28,25 @@ func (index UserIndex) DelUser(url string) {
 	delete(index, url)
 	imutex.Unlock()
 }
+
+func (index UserIndex) QueryUser(name string) []string {
+	var users []string
+	var entry string
+	for k, v := range index {
+		if strings.Contains(v.nick, name) {
+			entry = v.nick + "\t" + k + "\t" + string(v.apidate)
+			users = append(users, entry)
+		}
+	}
+
+	return users
+}
+
+// FindTag takes a user's tweets and looks for a given tag.
+// Returns the tweets with the tag as a []string.
+func (userdata *Data) FindTag(tag string) {
+	//for _, e := range userdata.status {
+	//parts := strings.Split(e, "\t")
+
+	//}
+}