Code Monkey home page Code Monkey logo

threat-collector's Introduction

Threat Collector

This Python script fetches blacklist data from a specified API endpoint and writes it to a new CSV file. It is designed to facilitate automated data retrieval and file operations through APIs.

Features

  • Fetching data from APIs
  • Support for HTTP Basic Authentication
  • Authentication using API tokens
  • Sending JSON body parameters for POST requests
  • Backing up existing output files

Usage

The script can be run with the following parameters:

python3 script.py --url <url> --output_file <output_file> [--api_token <api_token>] [--header <header>] [--username <username>] [--password <password>] [--body <body>]

Parameters

  • --url <url>: URL of the API endpoint including query parameters.
  • --output_file <output_file>: Path to the output CSV file.
  • --api_token <api_token>: (Optional) Token for API authentication.
  • --header <header>: (Optional) Custom header for the request.
  • --username <username>: (Optional) Username for HTTP Basic Authentication.
  • --password <password>: (Optional) Password for HTTP Basic Authentication.
  • --body <body>: (Optional) JSON formatted body for POST requests.

Example Usage

To fetch data from an API:

python3 script.py --url "https://api.example.com/data" --output_file "output.csv"

If an API token is required:

python3 script.py --url "https://api.example.com/data" --output_file "output.csv" --api_token "your_api_token"

Using HTTP Basic Authentication:

python3 script.py --url "https://api.example.com/data" --output_file "output.csv" --username "user" --password "password"

Installation

Before using this script, you need to install the required libraries:

pip install requests

License

This project is licensed under the MIT License. For more information, see the LICENSE file.

threat-collector's People

Contributors

mkdemir 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.