Index  | Recent Threads  | Unanswered Threads  | Who's Active  | Guidelines  | Search
 

Quick Go »
No member browsing this thread
Thread Status: Active
Total posts in this thread: 22
Posts: 22   Pages: 3   [ Previous Page | 1 2 3 | Next Page ]
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 5698 times and has 21 replies Next Thread
BobbyB
Veteran Cruncher
Canada
Joined: Apr 25, 2020
Post Count: 638
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Can't find history

You will find that wget eventually redirects to https://www.worldcommunitygrid.org/login/ with that wget request: same as if you tried to login without javascript turned on.

Now my question is how was your script able to get just your specific stats from a wget if that is what you used.

The downloadable file in "My activity" use to do just that as you can see in my post:
Yes all stats combined, on overview "My Activity", instead of 1 line for each project is better (for me anyway).
Part of the fun was keeping my own stats.

Maybe the downloadable file in "My activity over time" (with the graphics for each project) should do that. In any case the code is there to do just that and has been changed to combine all into one line.
I just deployed an update that restores this. See https://www.worldcommunitygrid.org/contribution/history

----------------------------------------
[Edit 2 times, last edit by BobbyB at Sep 24, 2021 5:03:34 PM]
[Sep 24, 2021 4:45:28 PM]   Link   Report threatening or abusive post: please login first  Go to top 
thunder7
Senior Cruncher
Netherlands
Joined: Mar 6, 2013
Post Count: 238
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Can't find history

Well, I basically did

wget $ARG --quiet --save-cookies /tmp/boinc_cookies.txt --keep-session-cookies --post-data 'j_username=<email address>&j_password=<password> https://www.worldcommunitygrid.org/j_security_check -O /tmp/boinc_login.html
wget $ARG --quiet --load-cookies /tmp/boinc_cookies.txt https://secure.worldcommunitygrid.org/ms/viewMyMemberPage.do -O $MONTHDIR/$DAYPREFIX\_contribution.html
wget $ARG --quiet --load-cookies /tmp/boinc_cookies.txt https://secure.worldcommunitygrid.org/ms/device/viewStatisticsByDevice.do
-O $MONTHDIR/$DAYPREFIX\_device_statistics.html

and then parsed the results from the contribution and device statistics pages.

What URL can I use to get the statistics per project?

Maybe the downloadable file in "My activity over time" (with the graphics for each project) should do that.


Well, it's downloadable if I use my mouse and click on it. My problem is in getting the right url to download it automatically.
[Sep 24, 2021 7:54:43 PM]   Link   Report threatening or abusive post: please login first  Go to top 
BobbyB
Veteran Cruncher
Canada
Joined: Apr 25, 2020
Post Count: 638
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Can't find history

I see what you mean and I had never delved that much into wget so the --post-data stuff is one on me. (time to read the docs again)

I tried the API and plenty of stuff comes in.
https://www.worldcommunitygrid.org/help/topic.s?shortName=api

Bottom line:
 https://www.worldcommunitygrid.org/api/members/{member name}/results?code={verification code}

It might take some time for you to tune the extra options to make it output what you need and I guess it depend on how often you do it. Then happy parsing

I use to take a screenshot every day and save but there is nothing to save anymore on the overview page. Then once every week or so download my stats and update my spreadsheet.
----------------------------------------
[Edit 1 times, last edit by BobbyB at Sep 24, 2021 9:32:08 PM]
[Sep 24, 2021 9:31:10 PM]   Link   Report threatening or abusive post: please login first  Go to top 
thunder7
Senior Cruncher
Netherlands
Joined: Mar 6, 2013
Post Count: 238
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Can't find history

OK, that actually gets me somewhere! Thanks.
[Sep 25, 2021 7:48:56 PM]   Link   Report threatening or abusive post: please login first  Go to top 
adriverhoef
Master Cruncher
The Netherlands
Joined: Apr 3, 2009
Post Count: 2346
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Can't find history

I tried the API and plenty of stuff comes in.
https://www.worldcommunitygrid.org/help/topic.s?shortName=api

Bottom line:
 https://www.worldcommunitygrid.org/api/members/{member name}/results?code={verification code}

It might take some time for you to tune the extra options to make it output what you need


Well, that is a good start and I guess we're lucky that that particular code still works, but you can't download all the data from a workunit using that code. Because with that same code you only see your own tasks, you will not find your wingmen's tasks.

Let me give an example:
HST1_307450_000056_AT0002_T325_F00001_S00071
Project name: Help Stop TB
Created: Sep. 24, 2021 - 21:02 UTC
Name: HST1_307450_000056_AT0002_T325_F00001_S00071
Minimum Quorum: 2
Replication: 2
Result name    OS type      Status      Sent time       Due / Return time  CPUtime/Elapsed Claimed/Granted
HST1_xxxxxxx_0 Linux Arch Valid 2021-09-24 21:02:30 2021-10-05 21:02:30 6.89/7.07 525.5/634.2
HST1_xxxxxxx_1 Linux Fedora Valid 2021-09-24 21:02:28 2021-10-05 21:02:28 7.9/8.09 248.3/634.2
(edited for brevity)

Here you see two tasks in a workunit.

I was using a script that tried to locate a certain workunit for me and then print out its data (the Workunit Status: Project Name, Workunit Creation time, Workunit Name, Minimum Quorum, Replication, and then the info from all tasks in that workunit: Result Name, OS type, OS version, App Version Number, Status, Sent Time, Time Due/Return Time, CPU Time/Elapsed Time, Claimed/Granted BOINC Credit), optionally followed by each Result Log (output created by running the task), simply by asking to specify the Device, the name of the science (app) and the status of the task, all interactively. Worked like a charm and actually, I didn't need to browse the website to find the data. The script did it all for me. It was very handy, for it also generated all formatting for me to post the output on the forum and it would keep the transient information alive on the forum.

However, with this new website design I don't know how it works crying , so I'm asking for help on this matter. How do you login with a script or how do you retrieve workunit information using a script now? confused
----------------------------------------
[Edit 1 times, last edit by adriverhoef at Sep 25, 2021 10:37:54 PM]
[Sep 25, 2021 9:48:01 PM]   Link   Report threatening or abusive post: please login first  Go to top 
virtual911
Cruncher
Joined: Jan 29, 2007
Post Count: 2
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Can't find history

I used to enjoy knowing my rank among donors. I don't find that info on the current website.
[Sep 26, 2021 3:17:01 AM]   Link   Report threatening or abusive post: please login first  Go to top 
BobbyB
Veteran Cruncher
Canada
Joined: Apr 25, 2020
Post Count: 638
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Can't find history

[Sep 26, 2021 9:38:14 PM]   Link   Report threatening or abusive post: please login first  Go to top 
alanb1951
Veteran Cruncher
Joined: Jan 20, 2006
Post Count: 1317
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Can't find history

Adri,
However, with this new website design I don't know how it works crying , so I'm asking for help on this matter. How do you login with a script or how do you retrieve workunit information using a script now? confused

You can't do it by grabbing the HTTP pages, as they use scripted routines to fetch the data from the API then format it... However, they are using the new standard API to get the data, so...

I presume you've found the "Swagger" API demonstration page accessed via https://www.worldcommunitygrid.org/api/docs/index.html; the test stuff there works fine as one is already logged in, of course, and you can suss out the URLs from the examples :-)

I've been playing with the new API because I already have scripts to fetch my results data using the old API and needed to make sure I could still do so with the new API. I had some success with that (though there are some interesting oddities...)

I've just thrown together a Python script to see if I can get the data you seem to want: this is just "proof of concept" so the output is not all-inclusive and hasn't been formatted nicely. Here is some partial output , which I'll follow with some notes on what was needed to do this...

Workunit reply information for Africa Rainfall Project
Metadata says 15 records available; fetched 15 records

Workunit 821667928 -- ARP1_0028850_091 Created; 2021-09-24T09:41:07+0000
Quorum 2, replication 3, results 3
ARP1_0028850_091_0 Linux Gentoo Valid
ARP1_0028850_091_1 Linux Ubuntu Invalid
ARP1_0028850_091_2 Linux Ubuntu Valid <---- Mine

Workunit 815939848 -- ARP1_0027060_092 Created; 2021-09-18T14:51:11+0000
Quorum 2, replication 2, results 3
ARP1_0027060_092_0 Linux LinuxMint Error
ARP1_0027060_092_1 Linux Debian Valid
ARP1_0027060_092_2 Linux Ubuntu Valid <---- Mine

...

Workunit 819735902 -- ARP1_0030748_094 Created; 2021-09-22T11:31:10+0000
Quorum 2, replication 2, results 2
ARP1_0030748_094_0 Linux Ubuntu Pending Validation <---- Mine
ARP1_0030748_094_1 Linux Linuxmint In Progress

...

(The "Mine" annotation is provided by looking at the value (true or false) of the "owner" field, by the way)

To connect, one needs to do what the Login form does, which entails doing a POST to https://www.worldcommunitygrid.org/api/v3/login with your email address and password as form values for j_username and j_password respectively. Provided that works, you're good to go (at present, anyway - Kevin Reed's fix for unsolicited requests to log in simplified what I needed to do, so it could get more complex again at some point!)

If you already worked out how to use the API but were held up by getting "logged in", you probably don't need the rest of this -- in that case, my apologies...

For the various things needed for the report, I used the /api/v3/ms/results and /api/c3/ms/workunit parts of the API. To find out a device ID, I used /api/v3/ms/devices and to get a project ID I used /api/v3/ms/results/projects (though I did cheat and use the Swagger API page to get those!)

Be aware that whilst the Swagger page formats the JSON to make it human-readable, direct use of the API gets the data as one long line.

Hope the above helps...

Cheers - Al.
----------------------------------------
[Edit 1 times, last edit by alanb1951 at Sep 26, 2021 9:56:57 PM]
[Sep 26, 2021 9:54:12 PM]   Link   Report threatening or abusive post: please login first  Go to top 
adriverhoef
Master Cruncher
The Netherlands
Joined: Apr 3, 2009
Post Count: 2346
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Can't find history

Hi Al,
Indeed I found the Swagger API and got lost somewhere in OAuth2 authentication a.o.
Fact is, I just didn't know the correct URL for authentication ever since the change to the newly designed website.

Thanks to you I managed to take my first step on the new website fetching my first workunit through a scripted login. The result is indeed one long line (JSON), which of course shouldn't be that much of a problem for me. wink

Al, I am really, really very glad that you have taken the time to reply, especially to give the correct URL. rose

(The "Mine" annotation is provided by looking at the value (true or false) of the "owner" field, by the way)
(Me looking at the JSON data…) Ah yes, I see! That's good to know.

If you already worked out how to use the API but were held up by getting "logged in", you probably don't need the rest of this -- in that case, my apologies...
Not at all, Al, no need to excuse, this has been all very helpful. Let's say we are heading in the right direction again. There's lots of work to do.

Thank you very much for the great help!

Adri
[Sep 26, 2021 11:51:06 PM]   Link   Report threatening or abusive post: please login first  Go to top 
BobbyB
Veteran Cruncher
Canada
Joined: Apr 25, 2020
Post Count: 638
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Can't find history

OK, so exactly where/how did you find the the "Swagger" API demonstration page". No link that I can find
[Sep 27, 2021 2:39:51 PM]   Link   Report threatening or abusive post: please login first  Go to top 
Posts: 22   Pages: 3   [ Previous Page | 1 2 3 | Next Page ]
[ Jump to Last Post ]
Post new Thread