Skip to content

Instantly share code, notes, and snippets.

@ymkjp ymkjp/wipo.rb
Created Jan 24, 2015

Embed
What would you like to do?
POST /branddb/jsp/select.jsp HTTP/1.1
Host: www.wipo.int
Accept: application/json, text/javascript, */*; q=0.01
X-Requested-With: XMLHttpRequest
Accept-Encoding: gzip, deflate
Accept-Language: en-us
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Origin: http://www.wipo.int
Content-Length: 901
Connection: keep-alive
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.2.5 (KHTML, like Gecko) Version/8.0.2 Safari/600.2.5
Referer: http://www.wipo.int/branddb/en/
Cookie: JSESSIONID=9BB37318F4000492704A41A70A7477DB; __utma=99021848.1978654428.1422084490.1422084490.1422084490.1; __utmb=99021848.12.10.1422084490; __utmc=99021848; __utmt=1; __utmz=99021848.1422084490.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
fl=BRAND%2CSOURCE%2CSTATUS%2Cscore%2COO%2CHOL%2CID%2CAD%2CVCS%2CUSC%2CNC%2CIMG%2CID&hl=true&hl.fragsize=5000&hl.requireFieldMatch=true&json.nl=map&wt=json&type=brand&sort=score%20desc%2CAD%20desc&rows=30&start=0&qi=2743-1422085146908&hl.fl=BRAND&q=BRAND%3Asamurai&facet=true&f.SOURCE.facet.limit=50&f.SOURCE.facet.mincount=1&f.STATUS.facet.limit=20&f.STATUS.facet.mincount=1&f.OO.facet.mincount=1&facet.field=SOURCE&facet.field=STATUS&facet.field=OO&facet.query=ITY%3AVERBAL&facet.query=ITY%3ANONVERBAL&facet.query=ITY%3ACOMBINED&facet.query=ITY%3AUNKNOWN&facet.query=ED%3A%5B*%20TO%20NOW%2FDAY%5D&facet.query=ED%3A%5BNOW%2FDAY-1MONTH%20TO%20NOW%2FDAY%5D&facet.query=ED%3A%5BNOW%2FDAY%2B1DAY%20TO%20*%5D&facet.query=ED%3A%5BNOW%2FDAY%2B1DAY%20TO%20NOW%2FDAY%2B1MONTH%5D&facet.query=ED%3A%5BNOW%2FDAY%2B1DAY%20TO%20NOW%2FDAY%2B6MONTHS%5D&facet.query=ED%3A%5BNOW%2FDAY%2B1DAY%20TO%20NOW%2FDAY%2B1YEAR%5D
{"response"=>
{"start"=>0,
"docs"=>
[{"AD"=>"2010-11-04T22:59:59Z",
"SOURCE"=>"AUTM",
"score"=>7.7831354,
"ID"=>"AUTM.1391412",
"HOL_EN"=>["Yudi Lin"],
"STATUS"=>"ACT",
"NC"=>[30],
"OO"=>"AU",
"BRAND_EN"=>["SUSHI "],
"IMG"=>"1391412.1.th.jpg"},
{"AD"=>"2004-11-10T22:59:59Z",
"SOURCE"=>"AUTM",
"score"=>7.7831354,
"ID"=>"AUTM.1029018",
"HOL_EN"=>["Sushi Sushi Holdings Pty Ltd"],
"STATUS"=>"DEL",
"NC"=>[29, 30, 43],
"OO"=>"AU",
"BRAND_EN"=>["SUSHI "],
"IMG"=>"1029018.1.th.jpg"},
{"AD"=>"2001-08-29T21:59:59Z",
"SOURCE"=>"ILTM",
"score"=>7.7831354,
"ID"=>"ILTM.151869",
"HOL_HE"=>["סנו מפעלי ברונוס בע\"מ"],
"HOL_EN"=>["Sano Brunos Enterprises Ltd."],
"BRAND_HE"=>["סושי"],
"STATUS"=>"ACT",
"NC"=>[16],
"OO"=>"IL",
"BRAND_EN"=>["SUSHI"]},
{"AD"=>"2001-01-30T22:59:59Z",
"SOURCE"=>"ILTM",
"score"=>7.7831354,
"ID"=>"ILTM.146218",
"HOL_HE"=>["סנו מפעלי ברונוס בע\"מ"],
"HOL_EN"=>["Sano Brunos Enterprises Ltd."],
"BRAND_HE"=>["סושי"],
"STATUS"=>"ACT",
"NC"=>[21],
"OO"=>"IL",
"BRAND_EN"=>["SUSHI"]},
{"AD"=>"1998-07-29T21:59:59Z",
"VCS"=>["26.03.05", "26.03.10"],
"SOURCE"=>"PHTM",
"score"=>7.7831354,
"ID"=>"PHTM.41998005596",
"HOL_EN"=>["CLARENCE SEE YU"],
"STATUS"=>"DEL",
"NC"=>[42],
"BRAND_EN"=>["SUSHI"],
"OO"=>"PH"},
{"AD"=>"1994-06-10T21:59:59Z",
"SOURCE"=>"AUTM",
"score"=>7.7831354,
"ID"=>"AUTM.631898",
"HOL_EN"=>[" Footworks Australasia Pty Ltd"],
"STATUS"=>"DEL",
"NC"=>[25],
"BRAND_EN"=>["SUSHI "],
"OO"=>"AU"},
{"AD"=>"1992-02-13T22:59:59Z",
"SOURCE"=>"AUTM",
"score"=>7.7831354,
"ID"=>"AUTM.572314",
"HOL_EN"=>[" Footworks Australia Pty Limited"],
"STATUS"=>"DEL",
"NC"=>[25],
"BRAND_EN"=>["SUSHI "],
"OO"=>"AU"},
{"AD"=>"2002-01-22T22:59:59Z",
"SOURCE"=>"AUTM",
"score"=>6.8793845,
"ID"=>"AUTM.900918",
"HOL_EN"=>["Sushi Sushi Holdings Pty Ltd"],
"STATUS"=>"ACT",
"NC"=>[29, 30, 43],
"OO"=>"AU",
"BRAND_EN"=>["SUSHI SUSHI "],
"IMG"=>"900918.1.th.jpg"},
{"AD"=>"2014-02-21T22:59:59Z",
"SOURCE"=>"IDTM",
"HOL"=>["PT. Interwira Lancar Mandiri"],
"score"=>5.684371,
"ID"=>"IDTM.J002014007271",
"BRAND"=>["SUSHI"],
"STATUS"=>"PEND",
"NC"=>[43],
"OO"=>"ID",
"IMG"=>"J002014007271"},
{"VCS"=>
["11.01.01",
"11.01.06",
"11.03.10",
"11.03.18",
"28.05.00",
"29.01.14"],
"AD"=>"2013-08-07T21:59:59Z",
"SOURCE"=>"MAD",
"HOL"=>["Limited Liability Company", "\"Zavod '\"KROL\""],
"score"=>5.684371,
"ID"=>"MAD_ACT.1178840",
"BRAND"=>["\nSUSHI.\n"],
"STATUS"=>"ACT",
"NC"=>[16, 30, 35, 43],
"OO"=>"RU",
"IMG"=>"1178840.jpg"},
{"AD"=>"2012-06-12T21:59:59Z",
"SOURCE"=>"USTM",
"USC"=>["26.01.15", "26.01.21", "27.03.01"],
"score"=>5.684371,
"ID"=>"USTM.79117439",
"HOL_EN"=>["XDP EXPANSION"],
"BRAND"=>["SUSHI'S"],
"STATUS"=>"ACT",
"NC"=>[29, 30, 43],
"OO"=>"US",
"IMG"=>"3000.png"},
{"VCS"=>["27.05.07", "27.05.10", "27.05.14", "29.01.14"],
"AD"=>"2012-06-12T21:59:59Z",
"SOURCE"=>"MAD",
"HOL"=>["XDP EXPANSION"],
"score"=>5.684371,
"ID"=>"MAD_ACT.1128044",
"BRAND"=>["sushi's"],
"STATUS"=>"ACT",
"NC"=>[29, 30, 43],
"OO"=>"EM",
"IMG"=>"1128044.jpg"},
{"AD"=>"2009-12-01T22:59:59Z",
"SOURCE"=>"IDTM",
"HOL"=>["HENDRA OETOMO"],
"score"=>5.684371,
"ID"=>"IDTM.D002009039065",
"BRAND"=>["SUSHI"],
"STATUS"=>"ACT",
"NC"=>[30],
"OO"=>"ID",
"IMG"=>"D002009039065"},
{"AD"=>"2009-07-06T21:59:59Z",
"SOURCE"=>"USTM",
"score"=>5.684371,
"ID"=>"USTM.77774716",
"HOL_EN"=>["Duel Co., Inc"],
"BRAND"=>["SUSHI"],
"STATUS"=>"ACT",
"NC"=>[28],
"OO"=>"US"},
{"AD"=>"2008-06-26T21:59:59Z",
"SOURCE"=>"CHTM",
"HOL"=>["Breuer & Co.\n", "Kommanditgesellschaft\n"],
"score"=>5.684371,
"ID"=>"CHTM.581102008",
"BRAND"=>["SUSHI "],
"STATUS"=>"ACT",
"NC"=>[43],
"OO"=>"CH",
"IMG"=>"6D9FB4821F9B159D458DE09405F13CE175BA1D06.jpeg"},
{"AD"=>"2007-09-07T21:59:59Z",
"SOURCE"=>"NZTM",
"score"=>5.684371,
"ID"=>"NZTM.775431",
"HOL_EN"=>["WILD PAIR LTD"],
"BRAND"=>["Sushi"],
"STATUS"=>"ACT",
"NC"=>[25],
"OO"=>"NZ"},
{"AD"=>"2005-08-24T21:59:59Z",
"SOURCE"=>"USTM",
"USC"=>["01.15.05", "10.01.02", "11.03.15", "24.17.16"],
"score"=>5.684371,
"ID"=>"USTM.78699873",
"HOL_EN"=>["2 Chix, Inc."],
"BRAND"=>["SUSHI"],
"STATUS"=>"DEL",
"NC"=>[25],
"OO"=>"US",
"IMG"=>"3000.png"},
{"VCS"=>["26.04.01", "26.04.05", "26.04.22", "27.05.01"],
"AD"=>"2005-05-20T21:59:59Z",
"SOURCE"=>"CATM",
"HOL"=>["Charlie Wong"],
"score"=>5.684371,
"ID"=>"CATM.1250568-00",
"BRAND"=>["SUSHI"],
"STATUS"=>"DEL",
"NC"=>[29, 30],
"OO"=>"CA",
"IMG"=>"1250568"},
{"AD"=>"2004-12-02T22:59:59Z",
"SOURCE"=>"USTM",
"score"=>5.684371,
"ID"=>"USTM.78525733",
"HOL_EN"=>["Minkin, Seth B."],
"BRAND"=>["SUSHI"],
"STATUS"=>"DEL",
"NC"=>[16],
"OO"=>"US"},
{"AD"=>"2004-03-08T22:59:59Z",
"SOURCE"=>"CHTM",
"HOL"=>["Shinsen AG\n"],
"score"=>5.684371,
"ID"=>"CHTM.515172004",
"BRAND"=>["SUSHi "],
"STATUS"=>"ACT",
"NC"=>[29, 30],
"OO"=>"CH",
"IMG"=>"4A3EDAF6B09220A33E257BB506B099430D1C6B43.png"},
{"AD"=>"2003-07-24T21:59:59Z",
"SOURCE"=>"USTM",
"score"=>5.684371,
"ID"=>"USTM.78278593",
"HOL_EN"=>["Sushi Partnership, The"],
"BRAND"=>["SUSHI"],
"STATUS"=>"DEL",
"NC"=>[28],
"OO"=>"US"},
{"AD"=>"2002-08-26T21:59:59Z",
"SOURCE"=>"USTM",
"score"=>5.684371,
"ID"=>"USTM.76443516",
"HOL_EN"=>["Pacific International Liquor, Inc."],
"BRAND"=>["SUSHI"],
"STATUS"=>"DEL",
"NC"=>[33],
"OO"=>"US"},
{"AD"=>"2000-10-03T21:59:59Z",
"SOURCE"=>"MAD",
"HOL"=>["ANIXI sprl"],
"score"=>5.684371,
"ID"=>"MAD_DEL.0745204",
"BRAND"=>["SUSHI"],
"STATUS"=>"DEL",
"NC"=>[16, 18, 25],
"OO"=>"BX"},
{"AD"=>"2000-06-02T21:59:59Z",
"SOURCE"=>"USTM",
"score"=>5.684371,
"ID"=>"USTM.78011065",
"HOL_EN"=>["Art Sound Productions, Inc."],
"BRAND"=>["SUSHI"],
"STATUS"=>"DEL",
"NC"=>[9, 35],
"OO"=>"US"},
{"AD"=>"2000-03-21T22:59:59Z",
"SOURCE"=>"USTM",
"score"=>5.684371,
"ID"=>"USTM.76006060",
"HOL_EN"=>["Human Inference Enterprise B.V."],
"BRAND"=>["SUSHI"],
"STATUS"=>"DEL",
"NC"=>[9],
"OO"=>"US"},
{"AD"=>"2000-03-20T22:59:59Z",
"SOURCE"=>"MAD",
"HOL"=>["Human Inference Enterprise B.V."],
"score"=>5.684371,
"ID"=>"MAD_DEL.0732698",
"BRAND"=>["SUSHI"],
"STATUS"=>"DEL",
"NC"=>[9],
"OO"=>"BX"},
{"AD"=>"1997-11-24T22:59:59Z",
"SOURCE"=>"USTM",
"score"=>5.684371,
"ID"=>"USTM.75395353",
"HOL_EN"=>["Encinas, Greg"],
"BRAND"=>["SUSHI"],
"STATUS"=>"DEL",
"NC"=>[28],
"OO"=>"US"},
{"AD"=>"1996-07-19T21:59:59Z",
"SOURCE"=>"USTM",
"score"=>5.684371,
"ID"=>"USTM.75136473",
"HOL_EN"=>["Hard Candy, Inc."],
"BRAND"=>["SUSHI"],
"STATUS"=>"DEL",
"NC"=>[25],
"OO"=>"US"},
{"AD"=>"1996-06-12T21:59:59Z",
"SOURCE"=>"USTM",
"score"=>5.684371,
"ID"=>"USTM.75117717",
"HOL_EN"=>["HARD CANDY, INC."],
"BRAND"=>["SUSHI"],
"STATUS"=>"DEL",
"NC"=>[3],
"OO"=>"US"},
{"AD"=>"1991-04-12T21:59:59Z",
"SOURCE"=>"USTM",
"score"=>5.684371,
"ID"=>"USTM.74157550",
"HOL_EN"=>["McCain Ellio's Foods, Inc."],
"BRAND"=>["SUSHI"],
"STATUS"=>"DEL",
"NC"=>[28],
"OO"=>"US"}],
"maxScore"=>7.7831354,
"numFound"=>2365},
"qi"=>"2285-1422386635681",
"facet_counts"=>
{"facet_queries"=>
{"ITY:VERBAL"=>68,
"ED:[NOW/DAY+1DAY TO NOW/DAY+1YEAR]"=>62,
"ED:[NOW/DAY+1DAY TO NOW/DAY+1MONTH]"=>1,
"ED:[NOW/DAY-1MONTH TO NOW/DAY]"=>3,
"ITY:COMBINED"=>1189,
"ED:[* TO NOW/DAY]"=>635,
"ED:[NOW/DAY+1DAY TO *]"=>790,
"ITY:NONVERBAL"=>0,
"ED:[NOW/DAY+1DAY TO NOW/DAY+6MONTHS]"=>21,
"ITY:UNKNOWN"=>88},
"facet_ranges"=>{},
"facet_dates"=>{},
"facet_intervals"=>{},
"facet_fields"=>
{"SOURCE"=>
{"OMTM"=>8,
"AETM"=>17,
"SGTM"=>103,
"MAD"=>63,
"KHTM"=>5,
"DKTM"=>25,
"BNTM"=>2,
"AUTM"=>243,
"CATM"=>171,
"PHTM"=>47,
"IDTM"=>132,
"EGTM"=>14,
"MATM"=>20,
"CHTM"=>43,
"USTM"=>963,
"NZTM"=>74,
"ILTM"=>49,
"EETM"=>15,
"MXTM"=>371},
"STATUS"=>{"del"=>850, "act"=>1234, "pend"=>281},
"OO"=>
{"no"=>0,
"ge"=>0,
"nz"=>74,
"gb"=>3,
"oa"=>0,
"fi"=>0,
"om"=>22,
"fr"=>6,
"gn"=>0,
"pe"=>0,
"pa"=>0,
"gh"=>0,
"pl"=>0,
"ph"=>47,
"gr"=>0,
"dt"=>0,
"dz"=>0,
"lv"=>2,
"lt"=>0,
"ea"=>0,
"ec"=>0,
"de"=>2,
"dd"=>0,
"mc"=>0,
"md"=>0,
"dk"=>27,
"ma"=>20,
"mg"=>0,
"me"=>0,
"mk"=>0,
"mn"=>0,
"mt"=>0,
"mx"=>371,
"us"=>971,
"mw"=>0,
"mz"=>0,
"my"=>0,
"eg"=>0,
"ee"=>15,
"ep"=>0,
"ua"=>2,
"em"=>6,
"ni"=>0,
"es"=>2,
"nl"=>0,
"ca"=>171,
"bw"=>0,
"jp"=>3,
"by"=>0,
"bx"=>4,
"br"=>0,
"bt"=>0,
"bn"=>2,
"kh"=>5,
"kg"=>0,
"ke"=>0,
"bf"=>0,
"bg"=>0,
"bh"=>0,
"be"=>0,
"kz"=>0,
"cz"=>0,
"cy"=>0,
"kp"=>0,
"se"=>2,
"cw"=>0,
"kr"=>0,
"sg"=>106,
"cu"=>0,
"cs"=>0,
"li"=>0,
"cr"=>0,
"co"=>0,
"cn"=>0,
"cl"=>0,
"ru"=>2,
"ch"=>50,
"lb"=>0,
"hr"=>0,
"hu"=>1,
"id"=>132,
"ie"=>0,
"iq"=>0,
"ir"=>0,
"az"=>0,
"is"=>0,
"it"=>4,
"ba"=>0,
"at"=>1,
"ar"=>0,
"il"=>49,
"in"=>0,
"au"=>246,
"al"=>0,
"ap"=>0,
"am"=>0,
"an"=>0,
"pt"=>0,
"ag"=>0,
"ae"=>17}}},
"sv"=>"bswa1.wipo.int",
"lastUpdated"=>1422064139568,
"highlighting"=>
{"ILTM.146218"=>{},
"AUTM.1029018"=>{},
"CHTM.581102008"=>{},
"USTM.75395353"=>{},
"CHTM.515172004"=>{},
"AUTM.900918"=>{},
"USTM.76006060"=>{},
"USTM.76443516"=>{},
"MAD_DEL.0745204"=>{},
"MAD_DEL.0732698"=>{},
"MAD_ACT.1128044"=>{},
"USTM.78278593"=>{},
"PHTM.41998005596"=>{},
"USTM.78011065"=>{},
"AUTM.631898"=>{},
"USTM.78525733"=>{},
"ILTM.151869"=>{},
"IDTM.D002009039065"=>{},
"USTM.79117439"=>{},
"USTM.75136473"=>{},
"CATM.1250568-00"=>{},
"IDTM.J002014007271"=>{},
"USTM.74157550"=>{},
"USTM.77774716"=>{},
"USTM.75117717"=>{},
"MAD_ACT.1178840"=>{},
"AUTM.572314"=>{},
"USTM.78699873"=>{},
"NZTM.775431"=>{},
"AUTM.1391412"=>{}}}
require 'net/http'
require 'uri'
require 'json'
require 'pp'
url = URI.parse('http://www.wipo.int/branddb/jsp/select.jsp')
req = Net::HTTP::Post.new(url.path)
req.body = URI.encode_www_form [
['q' , 'BRAND:sushi'],
['fl' , 'BRAND,SOURCE,STATUS,score,OO,HOL,ID,AD,VCS,USC,NC,IMG,ID'],
['hl' , 'true'],
['hl.requireFieldMatch' , 'true'],
['hl.fragsize' , '5000'],
['type' , 'brand'],
['facet' , 'true'],
['qi' , '2285-1422386635681'],
['json.nl' , 'map'],
['wt' , 'json'],
['sort' , 'score desc,AD desc'],
['rows' , '30'],
['start' , '0'],
['f.SOURCE.facet.limit' , '50'],
['f.SOURCE.facet.mincount' , '1'],
['f.STATUS.facet.limit' , '20'],
['f.STATUS.facet.mincount' , '1'],
['f.OO.facet.mincount' , '1'],
['facet.field' , 'SOURCE'],
['facet.field' , 'STATUS'],
['facet.field' , 'OO'],
['facet.query' , 'ITY:VERBAL'],
['facet.query' , 'ITY:NONVERBAL'],
['facet.query' , 'ITY:COMBINED'],
['facet.query' , 'ITY:UNKNOWN'],
['facet.query' , 'ED:[* TO NOW/DAY]'],
['facet.query' , 'ED:[NOW/DAY-1MONTH TO NOW/DAY]'],
['facet.query' , 'ED:[NOW/DAY+1DAY TO *]'],
['facet.query' , 'ED:[NOW/DAY+1DAY TO NOW/DAY+1MONTH]'],
['facet.query' , 'ED:[NOW/DAY+1DAY TO NOW/DAY+6MONTHS]'],
['facet.query' , 'ED:[NOW/DAY+1DAY TO NOW/DAY+1YEAR]'],
]
res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }
case res
when Net::HTTPSuccess, Net::HTTPRedirection
# OK
pp JSON.parse(res.body)
else
pp res.value
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.