Skip to content

Instantly share code, notes, and snippets.

@jagtalon
jagtalon / gist:2778508
Created May 23, 2012 23:46
Error messages
---Steve Martin Query---
DDG::ZeroClickInfo::Spice {
Parents Moo::Object
Linear @ISA DDG::ZeroClickInfo::Spice, Moo::Object
public methods (8) : call, caller, call_path, call_type, has_call, has_call_type, is_cached, new
private methods (0)
internals: {
call "/js/spice/google_plus/steve%20martin",
caller "DDG::Spice::GooglePlus",
package DDG::Spice::GooglePlus;
# ABSTRACT: Give the Google+ users matching the search item.
use DDG::Spice;
spice to => 'https://www.googleapis.com/plus/v1/people/$1?key={{ENV{DDG_SPICE_RANDWORD_APIKEY}}}&callback={{callback}}';
triggers startend => 'google+';
handle remainder => sub {
{
"response": {
"status": {
"version": "4.2",
"code": 0,
"message": "Success"
},
"artist": {
"name": "Weezer",
"biographies": [
@jagtalon
jagtalon / gist:2967590
Created June 21, 2012 18:27
Rotten Tomatoes
{
"total": 143,
"movies": [
{
"id": "771206971",
"title": "Madagascar 3: Europe's Most Wanted",
"year": 2012,
"mpaa_rating": "PG",
"runtime": 93,
"critics_consensus": "Dazzlingly colorful and frenetic, Madagascar 3 is silly enough for young kids, but boasts enough surprising smarts to engage parents along the way.",
@jagtalon
jagtalon / gist:3605543
Created September 2, 2012 23:16
Similar artists test
Query: similar to kanye west
You entered: similar to kanye west
DDG::ZeroClickInfo::Spice {
Parents Moo::Object
public methods (9) : call, call_data, caller, call_path, call_type, has_call, has_call_data, has_call_type, new
private methods (0)
internals: {
call "/js/spice/lastfm_artist/kanye%20west-similar",
caller "DDG::Spice::LastfmArtist",
@jagtalon
jagtalon / gist:3605611
Created September 2, 2012 23:30
Similar artists test with new return
Query: similar kanye west
You entered: similar kanye west
DDG::ZeroClickInfo::Spice {
Parents Moo::Object
public methods (9) : call, call_data, caller, call_path, call_type, has_call, has_call_data, has_call_type, new
private methods (0)
internals: {
call "/js/spice/lastfm_artist/kanye%20west/similar",
caller "DDG::Spice::LastfmArtist",
@jagtalon
jagtalon / gist:3606744
Created September 3, 2012 04:34
Last.fm Artists
package DDG::Spice::LastfmArtist;
# ABSTRACT: Search for musicians in Last.fm and get artists or bands similar to them.
use DDG::Spice;
spice to => 'http://ws.audioscrobbler.com/2.0/?format=json&method=artist.getinfo&artist=$1&api_key={{ENV{DDG_SPICE_LASTFM_APIKEY}}}&callback={{callback}}_$2';
spice from => '(?:([^/]*)/([^/]*)|)';
triggers any => 'similar', 'band', 'bands', 'musician', 'musicians', 'player', 'artist', 'artists', 'performer', 'performers', 'singer', 'singers';
@jagtalon
jagtalon / gist:3609928
Created September 3, 2012 15:01
Modified songs handler
Query: songs ben folds
You entered: songs ben folds
DDG::ZeroClickInfo::Spice {
Parents Moo::Object
public methods (9) : call, call_data, caller, call_path, call_type, has_call, has_call_data, has_call_type, new
private methods (0)
internals: {
call "/js/spice/lastfm_artist_tracks/ben%20folds",
caller "DDG::Spice::LastfmArtistTracks",
package DDG::Goodie::Test;
use DDG::Goodie;
use Data::Dumper;
triggers any => "test";
zci answer_type => "test";
zci is_cached => 1;
@jagtalon
jagtalon / Look out!
Created March 14, 2014 14:08
Guidelines
### Things that you need to look out for:
**Function:** Is the information shown in the instant answer better than using a regular organic link below?
**Relevancy:** Does the instant answer return relevant data from the source?
**Triggering:** Can you think of other ways of triggering the instant answer? (e.g. "calling codes for panama", "calling codes in panama", "panama calling codes")
**Adult:** Is the instant answer effectively not showing adult words or content by default (safe-search on)? There shouldn't be any adult imagery or profanity in instant answers.