| fjgarlin |
https://git.drupalcode.org/project/project_browser/-/tree/1.0.x/src/Drup... |
| chrisfromredfin |
This is the documentation for the API @tim https://www.drupal.org/drupalorg/docs/apis/rest-and-other-apis |
| chrisfromredfin |
So like if you wanted all the "projects" you could ask for https://www.drupal.org/api-d7/node.json?type=project_module |
| chrisfromredfin |
bear in mind that gives you only the first 50 I believe, then you have to ask for it by page |
| chrisfromredfin |
image.png |
| chrisfromredfin |
You go until there is no more .next - bearing in mind the url it gives you does not have .json appended to it (or .xml if that's your thing) |
| tim |
So always ask for "next" (after the first page of course) |
| chrisfromredfin |
yes if you want to get all |
| chrisfromredfin |
you can add more filters to the query, too |
| tim |
So if I want release tag data I would haveto ask for it from each module / project? |
| chrisfromredfin |
maybe, maybe not - you can get all releases: https://www.drupal.org/api-d7/node.json?type=project_release |
| tim |
Is there a way to query all tags and provide the NIDs associated with them?I might not be using the right terms.... |
| chrisfromredfin |
first of all, see if what you need is in the release data at link above |
| chrisfromredfin |
the project it's tied to is field_release_project, but you can't get all that data in one query, no - like you can't join 2 entities together using the existing api |
| chrisfromredfin |
you'd have to sort of reconstruct a database yourself with the linkages |
| fjgarlin |
there is also an specific endpoint for releases of a particular module: https://git.drupalcode.org/project/project_browser/-/blob/1.0.x/src/Plug... https://updates.drupal.org/release-history/webform/current |
| chrisfromredfin |
Ahh, right! What the update module uses; bear in mind I don't think we can get this one in JSON |
| fjgarlin |
the above json endpoint is probably more flexible anyway, as you can filter, sort, paginate, etc (edited) |
| tim |
So make php replace $project with what module I am looking for |
| tim |
fromhttps://updates.drupal.org/release-history/$project/current |
| chrisfromredfin |
yes would be the drupal project name - whatever is drupal.org/project/THIS_NAME |
| tim |
thank you both. |
| tim |
@chrisfromredfin So I got the script that you wrote ( I think you wrote) to work. changed it to pull 2 pages (200 total) at a time. It was coming back with warnings. I was using php7.4 cli. I changed to 8.0 but they were still there. Then after looking it's giving those errors when it's missing data generally. Although 1 case still giving error but it's putting data into the spreadsheet/file great for that record. So not sure whats with that, but ignore it, right?Also does matter which version of php? |
| chrisfromredfin |
no I'm sure it was built on 7.4. The warnings formissing data can likely be safely ignored as long as stuff is getting updated. |
| tim |
I modified the script to output the module name that it is processing to troubleshoot. That info, echo commands, and the error output to the terminal. If I run it with a redirect to output to a file only the echo commands are written to the file. No errors. Why is that? |
| tim |
I think it would be good to get an update. We have a new category and data has changed and I am going to work towards getting release data. Not sure how difficult it is. I think I will need to get a URL for each release?? but more on that later.Back to the basic record - The last question we are getting quite a few fields from each record. Some like'has issue queue','components','has releases','homepage url','changelog url','demo url','documentation url','screenshots url','license','number of images','number supporting orgs','issue version options',If I do a new pull I want it to be useful. If I leave these and a few other fields out would that hurt anybody's ability to make use of this new pull?I am think we could leave this info out. Unless somebody can actually use I will comment them out. Checking first. |
| chrisfromredfin |
In *nix, errors and standard output are in different "channels" |
Participants:
AmyJune (volkswagenchick), fjgarlin, tim, jjcs227, thejimbirch, irinaz, chrisfromredfin, Gábor Hojtsy, leslieg
Comments
Comment #9
leslieg commentedComment #10
leslieg commented