fablabbcn / fablabs.io

The platform of the global Fab Labs Network
https://fablabs.io
GNU Affero General Public License v3.0
67 stars 33 forks source link

Labs.json is returning very few results #464

Closed fibasile closed 5 years ago

fibasile commented 5 years ago

Describe the bug The number of results is not matching the number of labs

To Reproduce curl https://fablabs.io/labs.json

Expected behavior This url should return all published labs

viktorsmari commented 5 years ago

@fibasile It appears to be returning exactly 30. Is it paginated?

fibasile commented 5 years ago

Can't reproduce in staging (also now works in production)

Added a test in commit d9d4dd5e7d32db317fdd826a555d48a81f102abf

adriens commented 5 years ago

Hi, it seems like it only ouputs the current html page, hence between 25 and 30 ;-( Any idea on how get the whole json in a single shot please 🙏 ❓

adriens commented 5 years ago

2019-03-27 00_09_03-Mozilla Firefox

adriens commented 5 years ago

Does any one a ready to use full json around here ?

adriens commented 5 years ago

The json is always the same, whatever the page : it does not send the displayed fablabs 😿

fibasile commented 5 years ago

This endpoint is not working. Do you need the list for some project? The fablabs.io team is always open for collaborations.

adriens commented 5 years ago

Hi thank you @fibasile for your answer. I'd like to storytell about all the fablabs, based on the json 😸 There for, I wold need the exact datas stored in this json, but for all labs. If it's a csv, I could also handle it If you have datas about projects I'm also interested of course

I could already start to prototype a Dashboard on the actual json strcture ;-p

Have a look at the kind of custom things I produce : https://www.linkedin.com/in/adrien-sales/detail/recent-activity/shares/ https://www.linkedin.com/feed/update/urn:li:activity:6515481459036389376 https://www.linkedin.com/pulse/first-diy-iot-prototype-making-your-own-dashbutton-over-adrien-sales/ https://www.linkedin.com/pulse/first-fab-lab-steps-week0-adrien-sales/

So If you provide the the whole labs.io file that would be really great ❤️

fibasile commented 5 years ago

Nice projects!

You can get the list (paginated) using the authenticated api:

Create an app (after login, use the developer console on the upper-right menu), get a personal token.

Then with curl:

  curl -X GET 'https://api.fablabs.io/2/labs?page=0&per_page=100' \
  -H 'Authorization: Bearer <your_personal_token>' 

Btw the feed doesn't include any creation date, but you can add a feature request for this.

adriens commented 5 years ago

Got it 👍 I could get the labs 👏

adriens commented 5 years ago

So I have to do it ths way to get all of them (not missing a single one), right ?

curl -X GET 'https://api.fablabs.io/2/labs?page=0&per_page=200'
curl -X GET 'https://api.fablabs.io/2/labs?page=1&per_page=200'
curl -X GET 'https://api.fablabs.io/2/labs?page=2&per_page=200'
...
curl -X GET 'https://api.fablabs.io/2/labs?page=n&per_page=200'
adriens commented 5 years ago

Forget my question, I didn't see the meta/total-pages field 👍

adriens commented 5 years ago

It's all good 👍

adriens commented 5 years ago

@fibasile : I've released my article about FabLabs : https://www.linkedin.com/pulse/fablabs-data-story-telling-how-many-where-what-adrien-sales/

Have fun and thanks for this very cool api and site ! 👏 👍