| Index | Recent Threads | Unanswered Threads | Who's Active | Guidelines | Search |
| World Community Grid Forums
|
| No member browsing this thread |
|
Thread Status: Active Total posts in this thread: 65
|
|
| Author |
|
|
KerSamson
Master Cruncher Switzerland Joined: Jan 29, 2007 Post Count: 1684 Status: Offline Project Badges:
|
I try to fetch result status in json format using the API.
----------------------------------------If I place the request using wget or curl, whatever I give as option for limit and offset, I always received the first 25 results (ResultsReturned": "25", "Offset": "0"). However, if I perform exactly the same request interactively in Firefox, the returned json file is correct in terms of ResultsReturned (e.g. 250) and Offset (e.g. 750). I experience exactly the same behaviour for xml format. I've just spent a couple of hours trying to understand what is going wrong but I still do not have any clue. Help and support is welcome ! Cheers, Yves ---------------------------------------- [Edit 1 times, last edit by KerSamson at Nov 21, 2016 10:34:10 AM] |
||
|
|
adriverhoef
Master Cruncher The Netherlands Joined: Apr 3, 2009 Post Count: 2346 Status: Offline Project Badges:
|
That's odd, Yves, because it works for me. If you fill out the values for $MEMBER and $VERIFY and run
MEMBER="crunchingaccountname" # The name of your account with which you're crunchingwhat do you get? Adri |
||
|
|
KerSamson
Master Cruncher Switzerland Joined: Jan 29, 2007 Post Count: 1684 Status: Offline Project Badges:
|
Hi Adri,
----------------------------------------However, if the identical request is performed using wget or curl, the Limit and Offset arguments seem to be ignored. I found the cause for the trouble !!! wget "...." curl "...." Warm thanks Adri ! Since you help me to identify the missing quotes !!! I'm probably too tired !!! Cheers, Yves |
||
|
|
adriverhoef
Master Cruncher The Netherlands Joined: Apr 3, 2009 Post Count: 2346 Status: Offline Project Badges:
|
Good to hear that your problem has been resolved now, Yves. Are you writing a script or some such perhaps?
![]() |
||
|
|
KerSamson
Master Cruncher Switzerland Joined: Jan 29, 2007 Post Count: 1684 Status: Offline Project Badges:
|
Yes ! The first draft (PoC) is running for gathering the result files (json).
----------------------------------------The next step will be to read out the json to put the information into a database. The following step will to grab some additional html pages for gathering a couple of statistics like projects, team, etc. Cheers, Yves |
||
|
|
adriverhoef
Master Cruncher The Netherlands Joined: Apr 3, 2009 Post Count: 2346 Status: Offline Project Badges:
|
That's what I did, too, by using a flat file instead of a database. My script is called 'wcgresults' and it runs every hour from crontab: "xx * * * * bin/wcgresults -df misc/WCG.log". Maybe it's of some use to you (if you save it to a file, don't forget to 'chmod +x' it
---------------------------------------- ).EDIT: updated version of the script here: https://secure.worldcommunitygrid.org/forums/wcg/viewpostinthread?post=536034 [Edit 4 times, last edit by adriverhoef at Dec 10, 2016 1:40:46 AM] |
||
|
|
KerSamson
Master Cruncher Switzerland Joined: Jan 29, 2007 Post Count: 1684 Status: Offline Project Badges:
|
Hi Adri,
----------------------------------------I thank you for the input, I will read it carefully. My result collection script is much more limited. I will post it here as soon as I will consolidate it. The PoC is written in Unix shell (bash) but the objective is to have the most part of the application written in Python. I plan to use SQLite for storing the collected information. If you are interested with the concept, please send me an e-mail and I will send you more details. Cheers, Yves --- PS: You can find a valid e-mail address over my company web site. |
||
|
|
Former Member
Cruncher Joined: May 22, 2018 Post Count: 0 Status: Offline |
HI adriverhoef ;
I tried this commands MEMBER="blabla" mint@mint ~ $ VERIFY="blabla" mint@mint ~ $ wget "https://secure.worldcommunitygrid.org/api/mem...ERIFY&Limit=250" /api/mem...ERIFY&Limit=250 like you said before but i got this results Resolving secure.worldcommunitygrid.org (secure.worldcommunitygrid.org)... 198.20.8.246 Connecting to secure.worldcommunitygrid.org (secure.worldcommunitygrid.org)|198.20.8.246|:443... connected. HTTP request sent, awaiting response... 403 Forbidden 2016-12-09 10:41:05 ERROR 403: Forbidden. could you please tell me if i have to add something else to get my results in xml file |
||
|
|
adriverhoef
Master Cruncher The Netherlands Joined: Apr 3, 2009 Post Count: 2346 Status: Offline Project Badges:
|
K.BENZAOUI,
----------------------------------------You're on the right track. You need to look at the source of my posting to copy a useful URL, presented here in two parts to prevent the website's forum software from interpreting it: https://secure.worldcommunitygrid.org/ api/members/"$MEMBER"/results?code=$VERIFY&format=xml&Limit=250 If you join the two lines https... and api/... together (...grid.org/api/members/...), you should be more succesful. [Edit 2 times, last edit by adriverhoef at Dec 9, 2016 6:22:51 PM] |
||
|
|
adriverhoef
Master Cruncher The Netherlands Joined: Apr 3, 2009 Post Count: 2346 Status: Offline Project Badges:
|
Since using a long URL is causing trouble, I'm using the variable $URLBASE now in this new version of my script.
----------------------------------------EDIT: changing 'secure' to 'www' in the URLBASE. ---8< --- SNIP SNIP SNIP --- CUT HERE ---8< #!/bin/sh [Edit 3 times, last edit by adriverhoef at Dec 28, 2016 11:58:17 AM] |
||
|
|
|