List all my projects on homepage

Hello,

I would love a way to see all my projects on the homepage without having to go into an editor.
Also, when I click ‘Edit Code’ on the home page. it is not clear which project it is going to edit and always gives me some pause.

I think there are other topics on the forums on these ideas, and I tried to find them to add my comments there, but they were not easy to find, so I made a new topic, sorry.

Thank you!
Evelyn

4 Likes

Hey Evelyn,

Not a problem - Thanks for posting! We plan to eventually have a way for you to see all your projects you’ve done on your profile page (ie. glitch.com/@evelyn) without having to go into the editor.

As for ‘Edit Code’, what it does is open the editor onto the last project you’ve edited. Maybe ‘Resume Editing’ would be a clearer label?

1 Like

Thanks for the reply!

A user page sounds great!

Yes, ‘resume editing’ might be more clear! Or just some indication of which project will be opened, I rarely remember which one was the last one I was editing.

+1 for user profile pages! Would love to be able to see the other projects made by a user and also have a link to my profile of projects to share.

In the interim I was looking around to see if there is a way to query glitch for projects from a user and try out making a profile page glitch myself. Is there a glitch api I can use to get that data?

1 Like

https://api.glitch.com is the base API URL. I started building my own Glitch Dashboad and used https://api.glitch.com/boot to get the list of projects. It’s pretty bare bones at the moment but it works.

1 Like

Thanks for the blog @shindakun!

Is grabbing the auth token from a logged in session the best approach? Seems like it could be accidentally invalidated and break your dashboard.

Does glitch provide another way to generate auth tokens? Having it as an environment variable seems like it would be handy.

2 Likes

It totally could break it and since building it I’ve considered changing it to use something like the user search API call. That appears to have the benefit of only listing public projects the auth'd session approach shows all projects.

fetch(`https://api.glitch.com/users/search?q=shindakun`)
  .then((res) =>
    res.text()
  ).then((body) => {
    projects = JSON.parse(body)[0].projects
    }
  );

I suppose then you’d need to worry if search is returning the correct user as the first entry in the array. For mine though I’ll probably stick with the token based call and just update it if I ever need to.

2 Likes

FYI res.json() will parse JSON automatically, so you don’t have to call JSON.parse.

2 Likes

+1 to all of the above, I’m finally able to work on user profiles so hopefully I have some good news for you guys on that front in the coming weeks.

2 Likes

Good spot, not sure why I was still using res.text() other then it was late lol.

1 Like

https://list-projects.glitch.me/jakearchibald hope this helps! Just change the username at the end of the url.

5 Likes

I just updated my project to use /users/byLogins instead of /boot, making it much easier to remix: