Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
require 'net/http'
require 'json'
#hamilton RegionId
hamilton = 16
waikato = 14
# make a query to the Residential endpoiint of the trademe search api
# @param argument_hash Hash
# The keys are query string parameter values, check the trademe documentation to find
# supported parameters. The value for a hashes key is the same as the value for its parameter
# Documentation of trademe residential search api:
# @returns Hash with the json response.
def trademeGet(argument_hash)
base_uri = ""
# add the region/district to the argument_hash
argument_hash.each do |key, value|
base_uri += "&#{key}=#{value}"
uri = URI(base_uri)
res = Net::HTTP.get(uri)
puts trademeGet region: waikato, district: hamilton
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.