Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added my "Weather" extension #992

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

samuellouf
Copy link
Contributor

Hello,
I edited my "Weather" extension to fit the rules and to stop buggin.

Here are the blocks:
blocks

I removed the hats blocks because the only way they'd work was by monopolizing the whole API.

Hope you enjoy this extension.

@samuellouf
Copy link
Contributor Author

Uhhh...... Could somebody help me please?

@samuellouf
Copy link
Contributor Author

With the format

@Twingamerdudes
Copy link

Just run npm run format in your console, and then commit the changes

@GarboMuffin
Copy link
Member

per CONTRIBUTING.md you do not need to worry about format yourself, and again you dont need to close and re-open pull requests. that is spam.

@samuellouf
Copy link
Contributor Author

per CONTRIBUTING.md you do not need to worry about format yourself, and again you dont need to close and re-open pull requests. that is spam.

Ok.

@ghost
Copy link

ghost commented Aug 31, 2023

I made you a thumbnail!

Untitled

@samuellouf
Copy link
Contributor Author

I made you a thumbnail!

Untitled

Thanks a lot! 😄😄😄😄😄
I'm adding it right now.

@GarboMuffin GarboMuffin added the pr: new extension Pull requests that add a new extension label Oct 14, 2024
Copy link
Member

@yuri-kiss yuri-kiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed the merge conflicts for you.

longitude: crd.longitude,
accuracy: crd.accuracy
};
localStorage.TurboWarpGeolocationExtension_coordinates = JSON.stringify(TurboWarpGeolocationExtension_coordinates);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you shouldnt store peoples geolocation data in localstorage


async function getGeolocation() {
localStorage.TurboWarpGeolocationExtension_coordinates = '{}';
navigator.geolocation.getCurrentPosition(getGeolocation_bg_func_success, getGeolocation_bg_func_error, {enableHighAccuracy: true,timeout: 5000,maximumAge: 0});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you are going to have local support please use the Scratch.canGeolocate api

if (coordinates == 'here'){
coordinates = await getGeolocation();
}
var fetched_json = await Scratch.fetch('https://api.open-meteo.com/v1/forecast?latitude=' + coordinates.latitude + '&longitude=' + coordinates.longitude + '&current_weather=true&hourly=temperature_2m,relativehumidity_2m,windspeed_10m').then(r => r.text()).catch(() => '');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be let instead of var

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: new extension Pull requests that add a new extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants