Created
May 29, 2012 21:56
-
-
Save apeckham/2831042 to your computer and use it in GitHub Desktop.
groupme fetch image urls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'httparty' | |
| require 'ap' | |
| $url = ARGV.shift | |
| $cookie = ARGV.shift | |
| raise unless $url && $cookie | |
| class Client | |
| include HTTParty | |
| def self.messages(before_id) | |
| get("#{$url}&before_id=#{before_id}", headers: {"Cookie" => $cookie}) | |
| end | |
| end | |
| before_id = nil | |
| begin | |
| json = Client.messages(before_id) | |
| before_id = json['response']['messages'].last['id'] | |
| puts json['response']['messages'].map { |row| row['picture_url'] }.compact | |
| end while before_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment