lib/cure_line/user.rb in cure_line-0.1.2 vs lib/cure_line/user.rb in cure_line-0.1.3
- old
+ new
@@ -39,11 +39,11 @@
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
- m = html.match(/window.__PRELOADED_STATE__\s*=\s*({.+})/)
- raise "Not Found window.__PRELOADED_STATE__ in #{url}" unless m
+ 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]))
end
end
end