Skip to content

Instantly share code, notes, and snippets.

View calciphus's full-sized avatar

Brad Hubbard calciphus

View GitHub Profile
@calciphus
calciphus / sina_geo.rb
Created June 29, 2015 19:19
Count Geo Targets in Sina Sources
starttime = Time.now.to_f
if ARGV.size == 0
puts "Usage: $ ruby script.rb [-o][-j][-t] files_to_parse.json(can be an array) [> outputfile.csv]\n\nOptions:
-o\tSkip diagnostic messages and display results only
-j\tFormat output as JSON instead of CSV
-t\tSquelch results and only show time and counts"
else
toscan = ARGV
@calciphus
calciphus / topic_and_category_extraction.rb
Last active August 29, 2015 14:05
Topic and Category Extraction
starttime = Time.now.to_f
if ARGV.size == 0
puts "Usage: $ ruby script.rb [-o][-t] files_to_parse.json(can be an array) [> outputfile.csv]\n\nOptions:
-o\tSkip diagnostic and performance messages so output can be directly stored
-t\tSquelch results and only show time and statistics (diagnostic run)"
else
toscan = ARGV
@calciphus
calciphus / wordpress.csdl
Last active August 29, 2015 14:05
Wordpress Stream
interaction.type == "wordpress"
and wordpress.type == "post"
and language.tag == "en"
and language.confidence > 80
and
(
salience.title.topics exists
or
salience.content.topics exists
)
@calciphus
calciphus / gist:c455695249d05c2d6eef
Created July 14, 2014 22:40
CSDL Sample Language for trying out
//We start by defining TAGGING RULES
// we are tagging posts by cat fans
tag.fan "cat"
{
interaction.content contains_any "kitties, cats, kittens, meow"
OR
links.meta.description contains_any "cats, cat photos, kittens, kitten photos"
OR