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

⚑ Write a generateMap() Function using Ruby #4134

Closed
4 tasks
PineappleIOnic opened this issue Oct 3, 2022 · 8 comments
Closed
4 tasks

⚑ Write a generateMap() Function using Ruby #4134

PineappleIOnic opened this issue Oct 3, 2022 · 8 comments
Assignees
Labels
good first issue Good for newcomers hacktoberfest Issues that can win you some cool swags! product / functions Fixes and upgrades for the Appwrite Functions.

Comments

@PineappleIOnic
Copy link
Member

PineappleIOnic commented Oct 3, 2022

πŸ’­Β Introduction

Appwrite Functions allow you to extend and customize your Appwrite server functionality by executing your custom code 🀩 You can learn more in our official Appwrite Functions docs.

The backbone of Appwrite Functions is Open Runtimes, an environment for serverless cloud computing. Since all Open Runtime functions are valid Appwrite functions, we are looking for contributors to extend the Open Runtimes Examples repository.

Your task is to implement generateMap() function using Ruby. Please make sure to look at existing function examples and use them as a template for your function. This will help you keep the proper structure as well as provide information on how to test the function.

⚑ Function Details

Generate a screenshot of map location. Introduce support for openstreets. If necessary, introduce their secret keys as function variables. Provider to use, latitude and longitude should be received as payload, and a screenshot in base64 format should be returned.

Example function payload:

{"provider":"openstreets","lat":41.909986,"lng":12.3959136}

Successful function response:

{"success":true,"image":"iVBORw0KGgoAAAANSUhEUgAAAaQAAALiCAY...QoH9hbkTPQAAAABJRU5ErkJggg=="}

Error function response:

{"success":false,"message":"Latitude must be a valid number between -90 and 90."}

🎯 Requirements

  • Experience with Appwrite.
  • Experience with Ruby.
  • Knowledge to implement generateMap function.
  • Experience with Docker.

βœ…Β Task Summary

  • Ask to be assigned to the issue.
  • Implement function generateMap() in Ruby/ folder.
  • Manually execute the newly implemented function to ensure it works.
  • Submit a pull request in open-runtimes/examples and include screenshots of successful execution.

If you have questions, need any help, or just want to hang out, make sure to join us on our Discord server.

Happy Appwriting!

@PineappleIOnic PineappleIOnic added feature product / functions Fixes and upgrades for the Appwrite Functions. good first issue Good for newcomers hacktoberfest Issues that can win you some cool swags! labels Oct 3, 2022
@Shivansh-yadav13
Copy link

I would like to contribute

@Meldiron
Copy link
Contributor

Meldiron commented Oct 5, 2022

@Shivansh-yadav13 , thanks for your interest! πŸ™ Happy hacking! πŸŽƒ

@Meldiron
Copy link
Contributor

Meldiron commented Oct 6, 2022

@Shivansh-yadav13 I have updated the description of the issue a little. I have removed the requirement for googlemaps provider - you only need to implement OpenStreets. If you already have Google Maps finished, feel free to include it. We removed it as a requirement since some contributors didn't like the fact their API is behind a paywall - they require you to add a credit card to access the API. And that is a valid concern!

Happy hacking πŸ˜‡

@Shivansh-yadav13
Copy link

Hello @Meldiron I'm using https://github.com/WebGents/open_street_map
which gives a responses like postal code, address, road etc..
for screenshot I will have to use https://gitlab.com/Qwertie/osm_tile_grabber
I was not able to find any other which will generate a screenshot.

@Meldiron
Copy link
Contributor

@Shivansh-yadav13 Hey there πŸ‘‹ Looking at the source code of this library, it seems it uses the following endpoint: https://gitlab.com/Qwertie/osm_tile_grabber/-/blob/master/lib/osm_tile_grabber/osm_tile_grabber.rb#L55

Can we try to replicate the logic without using the library? It should be as simple as sending a proper request and parsing the response.

If it seems too complicated, you can use the library.

@Shivansh-yadav13
Copy link

Shivansh-yadav13 commented Oct 18, 2022

@Meldiron I have tried implementing it
there is one thing
open street will only allow if a User-Agent header exists so should we also take this from the users? like an env var?
Screenshot from 2022-10-18 14-36-42
https://operations.osmfoundation.org/policies/tiles/

@Meldiron
Copy link
Contributor

@Shivansh-yadav13 Great point! πŸ”₯ Yes, let's please create an env var for this.

@eldadfux
Copy link
Member

Thank you everyone for celebrating Hacktoberfest 22 with us! This issue will now be closed as we're getting ready to celebrate Hacktoberfest 23.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers hacktoberfest Issues that can win you some cool swags! product / functions Fixes and upgrades for the Appwrite Functions.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants