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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s