Viewing source of sites via fetch block no longer works
-
I’m aware that you guys are still working on fixing this block to “show dynamic content” and that makes sense, but could you guys instead introduce a new block for static content so that I can access APIs and stuff? I recently found out there’s a dog API to get information on dog breeds and to get pictures of dogs and I have a key and know which endpoints to use (luckily mostly via GET which is what a fetch does) but I can’t use them in CreatiCode because this still doesn’t work.It does work for sites like my website and but fails when it comes into contact with things returned as text or JSON or websites that may have code too complicated like indeed.com when I wanna analyse job hirings and stuff like that. The issue with Indeed may actually be that it’s too dynamic due to it using your location to show jobs near you but that’s not the point.
The new block to just get (generally static) page and non-page (like text files) data could look like this:
and if the indeed.com issue is a concern for you guys, then maybe they both could have extra parameter that specifies extra information to personalize page content:
in these parameters, the user agent is that of a Chromebook and the location (lat & long) is London, UK. Maybe user agent might be a stretch but the location would surely be useful for somewhat fixing the issue. It’s also probably not worth fixing if it doesn’t work after that since it might think CreatiCode is a bot (as it is) and might not want it scraping its pages, so we should respect its wishes. -
This block currently should already work for simple static sites like
https://www.google.com/search?q=dog
We will look into the issue with indeed.com, but most likely it won’t work for such sites that have checks for bots.
It would also not work for the “view-source” URL, since it expects the input starts with “http”
-
@info-creaticode Ah ok, but could you also make it support “view-source:” as well at least or just another block that will return the exact code?
-
We can add an option to return the page content as markdown or html.
-
@info-creaticode Oh that’s a good idea! Thank you!
-
This post was removed!
Reason: I realized that this is NOT what’s going on.
-
This block has been updated:
-
@info-creaticode thank you
-
@info-creaticode it works and it’s great, but could you make it so it returns the full webpage html code instead of just the<body>
tag? I also wanna see the<head>
tag for getting things like the title of the site and metadata. I’m thinking of now designing my websites so they have special metadata that when used in my CreatiCode web browser, they can have stuff like extra permissions and customizability and whatnot. -
@jeffreyrb03-gmail thank you guys for adding that in I just saw it gives the full code now