Code Monkey home page Code Monkey logo

ghalbeyou / flask-image-grabber Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 3.0 3.75 MB

Flask image grabberis a modern and lightweight Flask application that leverages the ipapi API to retrieve geolocation information based on the user's IP address. It also serves an image file specified in the URL.

Home Page: https://flask-image-grabber.vercel.app

License: MIT License

Python 100.00%
binascii deployment documentation easy file-handling flask free geolocation image image-logger ip ip-grabber mime-types png python serving web-application image-logger-tool

flask-image-grabber's Introduction

Flask image grabber ๐ŸŒ๐Ÿ”

Flask image grabberis a modern and lightweight Flask application that leverages the ipapi API to retrieve geolocation information based on the user's IP address. It also serves an image file specified in the URL.

Prerequisites ๐Ÿ“‹

Before running Flask image grabber, make sure you have the following prerequisites:

  • Python 3.x installed ๐Ÿ
  • Flask library installed (pip install flask) ๐ŸŒ
  • Requests library installed (pip install requests) ๐Ÿ“ฆ

Setup โš™๏ธ

To set up Flask image grabber, follow these steps:

  1. Sign up for a free API key from ipapi.com if you don't have one already. ๐Ÿ”‘
  2. Replace the API_KEY variable in the code with your actual API key. ๐Ÿ”’
  3. Make sure the image file (image.png) you want to serve is in the same directory as the Flask application file. ๐Ÿ–ผ๏ธ
  4. Provide appropriate permissions to the info.txt file so that the Flask application can write to it. ๐Ÿ“

Usage ๐Ÿš€

To use Flask image grabber, follow these steps:

  1. Start the Flask application by running the following command:

    python app.py
    
  2. Access the Flask application in your web browser or via curl/wget commands with the following URL pattern:

    http://localhost:5000/<image_name>
    

    Replace <image_name> with the name of the image file you want to serve. For example:

    http://localhost:5000/image.png
    
  3. The Flask application will retrieve the geolocation information for the user's IP address using the ipapi API and save it to the info.txt file.

  4. The Flask application will then serve the image file to the user. ๐Ÿ–ผ๏ธ

Note: If you access the Flask application locally using 127.0.0.1 as the IP address, it will display a message indicating that it's for testing purposes only. To get accurate geolocation information, upload the Flask application to a hosting environment. ๐ŸŒ

License ๐Ÿ“œ

Flask image grabberis open source and available under the MIT License. ๐Ÿ“ƒ

flask-image-grabber's People

Contributors

ghalbeyou avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.