Class: Weibo::Api::V2::Location

Inherits:
Base
  • Object
show all
Defined in:
lib/weibo_focus/api/v2/location.rb

Instance Method Summary collapse

Methods inherited from Base

#hashie, #initialize

Constructor Details

This class inherits a constructor from Weibo::Api::V2::Base

Instance Method Details

#base_get_map_image(opt = {}) ⇒ Object

read interfaces



7
8
9
# File 'lib/weibo_focus/api/v2/location.rb', line 7

def base_get_map_image(opt={})
  hashie get("location/base/get_map_image.json", :params => opt)
end

#geo_address_to_geo(address, opt = {}) ⇒ Object



15
16
17
# File 'lib/weibo_focus/api/v2/location.rb', line 15

def geo_address_to_geo(address, opt={})
  hashie get("location/geo/address_to_geo.json", :params => {:address => address}.merge(opt))
end

#geo_geo_to_address(coordinate, opt = {}) ⇒ Object



19
20
21
# File 'lib/weibo_focus/api/v2/location.rb', line 19

def geo_geo_to_address(coordinate, opt={})
  hashie get("location/geo/geo_to_address.json", :params => {:coordinate => coordinate}.merge(opt))
end

#geo_gps_to_offset(coordinate, opt = {}) ⇒ Object



23
24
25
# File 'lib/weibo_focus/api/v2/location.rb', line 23

def geo_gps_to_offset(coordinate, opt={})
  hashie get("location/geo/gps_to_offset.json", :params => {:coordinate => coordinate}.merge(opt))
end

#geo_ip_to_geo(ip, opt = {}) ⇒ Object



11
12
13
# File 'lib/weibo_focus/api/v2/location.rb', line 11

def geo_ip_to_geo(ip, opt={})
  hashie get("location/geo/ip_to_geo.json", :params => {:ip => ip}.merge(opt))
end

#geo_is_domestic(coordinates, opt = {}) ⇒ Object



27
28
29
# File 'lib/weibo_focus/api/v2/location.rb', line 27

def geo_is_domestic(coordinates, opt={})
  hashie get("location/geo/is_domestic.json", :params => {:coordinate => coordinate}.merge(opt))
end

#line_bus_line(q, opt = {}) ⇒ Object



61
62
63
# File 'lib/weibo_focus/api/v2/location.rb', line 61

def line_bus_line(q, opt={})
  hashie get("location/line/bus_line.json", :params => {:q => q}.merge(opt))
end

#line_bus_route(opt = {}) ⇒ Object



57
58
59
# File 'lib/weibo_focus/api/v2/location.rb', line 57

def line_bus_route(opt={})
  hashie get("location/line/bus_route.json", :params => opt)
end

#line_bus_station(q, opt = {}) ⇒ Object



65
66
67
# File 'lib/weibo_focus/api/v2/location.rb', line 65

def line_bus_station(q, opt={})
  hashie get("location/line/bus_station.json", :params => {:q => q}.merge(opt))
end

#line_drive_route(opt = {}) ⇒ Object



53
54
55
# File 'lib/weibo_focus/api/v2/location.rb', line 53

def line_drive_route(opt={})
  hashie get("location/line/drive_route.json", :params => opt)
end

#mobile_get_location(opt = {}) ⇒ Object

to implement



48
49
50
51
# File 'lib/weibo_focus/api/v2/location.rb', line 48

def mobile_get_location(opt={})
  #hashie get("location/mobile/get_location.json", :params => opt)
  nil
end

#pois_add(srcid, name, address, city_name, category, longitude, latitude, opt = {}) ⇒ Object

write interfaces



70
71
72
73
74
75
76
77
78
# File 'lib/weibo_focus/api/v2/location.rb', line 70

def pois_add(srcid, name, address, city_name, category, longitude, latitude, opt={})
  hashie post("location/pois/add.json", :params => {:srcid => srcid,
                                                    :name => name,
                                                    :address => address,
                                                    :city_name => city_name,
                                                    :category => category,
                                                    :longitude => longitude,
                                                    :latitude => latitude}.merge(opt))
end

#pois_search_by_area(coordinates, opt = {}) ⇒ Object



43
44
45
# File 'lib/weibo_focus/api/v2/location.rb', line 43

def pois_search_by_area(coordinates, opt={})
  hashie get("location/pois/search/by_area.json", :params => {:coordinate => coordinate}.merge(opt))
end

#pois_search_by_geo(opt = {}) ⇒ Object



39
40
41
# File 'lib/weibo_focus/api/v2/location.rb', line 39

def pois_search_by_geo(opt={})
  hashie get("location/pois/search/by_geo.json", :params => opt)
end

#pois_search_by_location(opt = {}) ⇒ Object



35
36
37
# File 'lib/weibo_focus/api/v2/location.rb', line 35

def pois_search_by_location(opt={})
  hashie get("location/pois/search/by_location.json", :params => opt)
end

#pois_show_batch(srcids, opt = {}) ⇒ Object



31
32
33
# File 'lib/weibo_focus/api/v2/location.rb', line 31

def pois_show_batch(srcids, opt={})
  hashie get("location/pois/show_batch.json", :params => {:srcids => srcids}.merge(opt))
end