Skip to content

Instantly share code, notes, and snippets.

@zeke
Created January 3, 2012 03:56
Show Gist options
  • Save zeke/1553406 to your computer and use it in GitHub Desktop.
Save zeke/1553406 to your computer and use it in GitHub Desktop.
Fetch top Wordnik lookups from the past six weeks using the garb gem.
Top Lookups, 1 week(s) ago
diaphanous 4251
exigent 3358
fervid 3326
stolid 3037
interdict 2941
undulate 2536
depose 2276
disclose 1647
subterfuge 1223
dictionary 905
qis 535
qaid 477
qadi 452
qi 407
davenport 387
rotl 375
inia 327
love 322
raia 313
Scrabble 309
surquedry 299
qoph 287
fuck 283
Orakpo's 273
jeu 258
basorexia 257
quai 255
memogate 255
magic 248
Hogmanay 242
zoa 238
ajee 237
jee 236
airn 236
airt 232
apricity 219
enol 215
qat 213
gree 211
hisn 210
djin 209
wordnik 208
poppysmic 207
toit 202
jeed 201
tirl 199
irid 198
eath 198
emeu 190
neif 189
oorie 188
dirl 187
ohia 185
caid 184
tain 182
izar 182
cuif 181
quey 178
thir 177
haet 177
alan 177
azon 175
unau 174
asea 174
iwis 172
sned 170
grrr 164
zin 162
invective 162
rato 159
vrow 158
hent 156
hello 156
fi 156
(null) 155
anta 154
eyne 152
za 151
unde 151
tela 151
sith 150
oxo 150
reis 149
sex 148
olea 148
hunh 148
axite 148
Avicii 146
vau 145
lol 145
gox 145
trie 144
iglu 143
alae 143
anil 142
zarf 141
yirr 139
ugli 139
miri 139
agha 139
unci 138
zas 137
meme 136
dite 135
nurl 134
kampai 134
atronach 134
zoon 133
zona 133
maladroit 133
equivocate 132
amia 132
eche 131
dawt 131
telivision 130
soja 129
shagrin 129
coof 129
shuffling 128
quate 128
cete 127
jear 126
bize 126
isba 125
sain 124
egis 124
vaw 123
peag 123
orad 122
eaux 122
jole 121
word 120
tref 120
aquae 120
toyo 119
reif 119
qaids 118
izle 118
turgid 117
test 117
fique 117
fice 117
ouph 116
mair 116
qued 115
putative 115
hern 115
egal 115
anes 115
zaftig 114
gleg 114
emyd 114
tought 113
qadis 113
Septien 113
teel 112
sorn 112
pirn 112
jeux 112
blet 112
Magism 111
zek 110
tyee 109
tree 109
suq 109
doat 109
biga 109
yird 108
unbe 108
ourie 108
heh 108
anas 108
yald 107
toph 107
quare 107
lier 106
jow 106
epha 105
twae 104
grue 104
divit 104
google 103
santorum 102
lunt 102
fere 102
djinn 102
olla 101
juco 101
cunt 101
tola 100
heth 100
emoji 100
Top Lookups, 2 week(s) ago
subterfuge 4515
diaphanous 3934
invective 1381
dissemble 1249
bonhomie 1019
judicious 857
pittance 808
ratify 660
apricity 380
qis 321
qaid 304
qadi 304
qi 281
memogate 256
rotl 217
Scrabble 213
inia 202
qoph 188
jee 183
quai 182
zoa 172
feriation 170
surquedry 163
love 163
jeu 159
raia 157
qat 155
dictionary 155
ajee 153
basorexia 146
cuif 138
eath 135
atronach 134
airt 134
enol 132
shagrin 131
Orakpo's 131
tirl 130
izar 130
haet 126
airn 126
unau 124
sith 123
quey 123
ohia 122
caid 121
emeu 120
gree 119
djin 118
brumal 118
Avicii 118
jeed 117
Septien 117
oorie 116
iwis 116
neif 115
tought 113
hisn 111
irid 109
zas 108
lissotrichous 108
upsot 107
tain 107
quate 107
izle 106
toit 105
oxo 105
dulcet 105
eccumenical 104
zoon 102
hunh 102
poppysmic 101
Top Lookups, 3 week(s) ago
sectarian 1195
astringent 1047
salutary 990
amity 847
judicious 806
fatuous 797
beseech 628
contract 386
qadi 295
ultraluminal 292
apricity 290
qi 262
qis 254
qaid 249
memogate 237
Scrabble 209
dictionary 205
qoph 177
surquedry 171
love 170
Thalaivar 168
jeu 164
rotl 162
tought 150
atronach 150
Avicii 148
kipple 146
inia 145
shagrin 142
axis 141
douceur 140
quai 139
zoa 136
ajee 136
jee 132
owness 131
qat 129
globulate 126
ohia 125
izle 116
basorexia 116
raia 115
jeed 115
cuif 114
segueway 112
globulates 111
djin 111
barbican 110
oorie 107
douleia 107
hello 105
airt 105
dysania 104
pruinose 103
haet 101
contemplation 101
jeux 100
Top Lookups, 4 week(s) ago
invidious 999
pontificate 964
pious 662
arbitrary 655
discourse 645
mirth 593
beseech 587
prodigal 489
surquedry 423
qi 351
qis 230
qadi 221
dictionary 219
qaid 212
mellifluous 211
tought 193
Scrabble 192
qat 188
solemn ceremony 184
Lisztomania 184
rotl 176
equivocate 172
zaftig 170
turgid 170
love 166
qoph 164
Thalaivar 164
putative 153
inia 146
cuif 145
atronach 138
uninfluenced 132
quiddity 130
ajee 128
jeu 126
jee 125
zoa 124
douceur 123
moreish 119
(null) 119
suq 116
shagrin 113
compendious 113
stammer 112
qua 109
incipient 108
sith 107
owness 107
malevolent 106
izle 106
raia 105
irrefragable 105
haggard 105
neif 104
improvident 104
emeu 104
uncanny 103
proverb 103
overtone 102
multibrand 102
imperious 102
cat 102
sinister 100
recompence 100
gnashed 100
airt 100
Top Lookups, 5 week(s) ago
utilitarian 684
desecrate 682
brevity 672
jurisprudence 613
arbitrary 612
credence 588
dither 577
surquedry 416
qi 353
tought 263
morose 246
rotl 245
multibrand 236
agelast 232
qat 207
chantepleure 204
qaid 192
cuif 191
zaftig 177
inia 177
qis 176
equivocate 172
dictionary 169
qadi 168
solemn ceremony 164
raia 155
putative 152
(null) 151
jentacular 147
turgid 146
love 146
sith 145
izle 145
cat 136
qoph 134
gree 131
univocal 129
atronach 123
ajee 117
suq 116
airn 116
poppysmic 115
Scrabble 114
abase 111
qua 110
hisn 110
emeu 110
airt 110
za 108
haet 108
toit 107
dorpt 104
quiddity 103
low-lying clouds 103
enol 103
eath 102
tirl 101
Top Lookups, 6 week(s) ago
truculent 675
chuffiness 370
tought 303
sophiology 297
multibrand 268
noetic 265
superannuated 264
martinet 256
flibbertigibbet 253
backwash 248
protean 245
morose 226
réchauffé 199
syncretion 198
theophanic 188
agelast 187
wily 173
izle 172
boffinry 167
cherpumple 164
poppysmic 163
rotl 156
latent 153
fulsome 152
pooh-bah 135
slake 130
festinate 126
turducken 125
(null) 124
dictionary 123
advocate 120
raia 115
insouciance 115
inia 107
pornstar 106
callithump 106
lugubrious 102
qi 100
require 'rubygems'
require 'garb'
if ARGV.size < 3
puts "\nUsage: ruby garb.rb <username> <password> <UA-XXXXXXX-X>\n\n"
exit
end
username = ARGV[0]
password = ARGV[1]
ua = ARGV[2]
class PageViews
extend Garb::Model
metrics :pageviews
dimensions :page_path
end
class Reports
def self.top_word_lookups(profile, weeks_ago=1)
PageViews.results(
profile,
:start_date => (Date.today - 7*weeks_ago),
:end_date => (Date.today - 7*(weeks_ago-1)),
:filters => {:pageviews.gte => 100, :page_path.contains => '/words/'},
:sort => :pageviews
)
end
end
Garb::Session.login(username, password)
profile = Garb::Management::Profile.all.detect {|p| p.web_property_id == ua}
1.upto(6) do |weeks_ago|
puts "\n\nTop Lookups, #{weeks_ago} week(s) ago"
results = Reports.top_word_lookups(profile, weeks_ago)
results.entries.reverse.map do |entry|
word = entry.page_path.split("words/").last
count = entry.pageviews.to_i
puts [word, " " * (40-word.size), count].join("")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment