lib/cure_line/user.rb in cure_line-0.1.3 vs lib/cure_line/user.rb in cure_line-1.0.0
- old
+ new
@@ -37,10 +37,10 @@
options = {}
options["User-Agent"] = CureLine.config.user_agent if CureLine.config.user_agent
url = "https://timeline.line.me/user/#{user_id}"
- html = open(url, options).read
+ html = URI.open(url, options).read
m = html.match(%r{<script id="init_data" type="application/json">({.+})</script>})
raise %Q(Not Found <script id="init_data" type="application/json"> in #{url}) unless m
@preloaded_state = CureLine::Mash.new(JSON.parse(m[1]))