whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Also fetch cookie for other methods
Date Mon, 16 Mar 2020 14:04:55 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new dc8e944  Also fetch cookie for other methods
dc8e944 is described below

commit dc8e9441970f06b9c08e8dd0f5982ec845c0ebff
Author: Sebb <sebb@apache.org>
AuthorDate: Mon Mar 16 14:04:47 2020 +0000

    Also fetch cookie for other methods
---
 tools/ponyapi.rb | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/ponyapi.rb b/tools/ponyapi.rb
index 60519a4..ad327d8 100644
--- a/tools/ponyapi.rb
+++ b/tools/ponyapi.rb
@@ -26,6 +26,7 @@ module PonyAPI
   # The method writes the file 'lists.json' if dir != nil
   # it returns the data as a hash
   def get_pony_lists(dir, cookie=nil, sort_list=false)
+    cookie=get_cookie() if cookie == 'prompt'
     jzon = get_pony_prefs(nil, cookie)
     lists = jzon['lists']
     if lists
@@ -83,6 +84,7 @@ module PonyAPI
   # Download one month of stats as a JSON
   # Must supply cookie = 'ponymail-logged-in-cookie' if a private list
   def get_pony_stats(dir, list, subdomain, year, month, cookie)
+    cookie=get_cookie() if cookie == 'prompt'
     args =  make_args(list, subdomain, year, month)
     uri, request, response = fetch_pony(PONYSTATS % args, cookie)
     if response.code == '200' then
@@ -107,6 +109,7 @@ module PonyAPI
   
   # Get multiple years/months of public stats as json
   def get_pony_stats_many(dir, list, subdomain, years, months, cookie)
+    cookie=get_cookie() if cookie == 'prompt'
     years.each do |y|
       months.each do |m|
         get_pony_stats dir, list, subdomain, y, m, cookie
@@ -118,6 +121,7 @@ module PonyAPI
   # Caveats: uses response's encoding; overwrites existing .json file
   # Must supply cookie = 'ponymail-logged-in-cookie' if a private list
   def get_pony_mbox(dir, list, subdomain, year, month, cookie)
+    cookie=get_cookie() if cookie == 'prompt'
     args =  make_args(list, subdomain, year, month)
     uri, request, response = fetch_pony(PONYMBOX % args, cookie)
     if response.code == '200'
@@ -131,6 +135,7 @@ module PonyAPI
   
   # Get multiple years/months of mboxes
   def get_pony_mbox_many(dir, list, subdomain, years, months, cookie)
+    cookie=get_cookie() if cookie == 'prompt'
     years.each do |y|
       months.each do |m|
         get_pony_mbox dir, list, subdomain, y, m, cookie


Mime
View raw message