Search Gear #20 Cleaning Up

Cleaning up those nasty files

func (tw *twitter) cleanUp(entity string) (string, error) {
if entity == "" {
entity = "myHome"
}
cleanTime := time.Now().AddDate(0, 0, -2)

fileName := strings.Join([]string{entity, "_", cleanTime.Format("2006-01-02"), ".json"}, "")

if err := os.Remove(fileName); err != nil {
log.Println("Failed to", err)
}

return fileName, nil
}

 

So why not have this as a cloud service, and why not allow the grouping of people you follow?

Also investigate twitter security better, especially around the developer api.

Implement OAuth and encrypted tokens before algorithms.

Swap order in collect so that a file is created / opened only if there is a tweet to be written to it.

Leave a comment