Search Gear #7 – gocheck, gobyexample, toml-go!

Search Gear Notes

Search Gear Notes

Go, gocheck, gobyexample, toml-go

Thanks to @gniemeyer – gustavo @ http://niemeyer.net who pointed me at http://tour.golang.org/ so that I could understand receivers (which is the way go does methods).

Stumbled over closures – but put right by @mmcgrana https://gobyexample.com/closures

Alright now it’s time to get started – but I think I’ll use the vanilla go testing framework to start with.

So initially (see Day 5): I need to

Consider i18n and a user file to drive the user config.
Pull in the API keys from the config,
pull in the hashtags that might be useful

This suggests an initial structure for the config file – and with reference to twitter.

So something in TOML (Tom’s Obvious, Minimal Language – https://github.com/toml-lang/toml) might be

====

config for the searchgear application

[search-gear]
twitter-key = “” # Should this just be Hard coded I wonder
twitter-secret = “” # Should this just be Hard coded I wonder, not very secret in the config file.
start-at = 00 # When should an email be sent – the 24h cycle is implicit – eventually these episodes will need connecting for better summarisation.

config for twitter

[twitter]
user-key = “”
user-secret = “”
specific-users = [
“@gniemeyer”,
“@mmcgrana”
] # Need this if we want all tweets from an individuals to be summarised separately.
specific-tags = [
“#golang”,
“#hci”,
“#w4aYY” #catch yearly events without specifying – will need to implement / pass to a regex parser.
] # Need this if we want all tweets from a tag to be summarised separately.

config for other APIs…

====

Regular Expressions http://golang.org/pkg/regexp/https://code.google.com/p/re2/wiki/Syntax
#w4aYY = #w4a[4 digits][last 2 digits ]

So other things to consider is that each config search API parameters will have a critical error flag which if present will skip searchgear using that API.

KILL ME!
now the code which ran OK on Friday is not running today – many go errors! Reboot for tomorrow – but why? Well the notes have already proved useful to backtrack working examples!

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