Code Monkey home page Code Monkey logo

pastebin-api-python2-3's Introduction

Packagist Packagist DUB

pastebin-API-python2-3

A Class for using the pastebin API in python 2 and 3.

Usage

> from paste_bin import PasteBinApi
>
> api        = PasteBinApi(dev_key="my secret api dev key")                       # Create api object
> user_key   = api.user_key(username="my username", password="my password ")      # Create user key
> link       = api.paste(user_key,                                               
                         title="my title",
                         raw_code="my code",
                         private=None,                                            # Returns link to new paste  
                         api_paste_format=None,
                         expire_date=None
                         ) 
> trends        = api.trends()                                                    # Returns trending pastes 
> pastes        = api.list_pastes(user_key=user_key, limit=50)                    # Returns n ammount of pastes from user
> raw_paste     = api.get_raw(user_key=user_key, paste_key="Paste key")           # Returns raw paste data
> user_info     = api.user_info(user_key=user_key)                                # Returns user info for user
> delete_paste  = api.delete_paste(user_key=user_key, paste_key="Paste key")      # Deletes a paste

Example

##########################################
  Simple Pastebin Email:Password Scraper 
##########################################

#!/usr/bin/python3

from paste_bin import PasteBinApi
import re
import requests

api_dev_key = ""

email_list = []

api = PasteBinApi(api_dev_key)
trends = api.trends()
paste_key  = re.findall("\<paste\_key\>(.{1,50})\<", trends)

print("[*] Scraping pastebin...\n")

for key in paste_key:
    r   = requests.get("https://pastebin.com/raw/{0}".format(key))
    data = r.text
    for line in data.split('\n'):
        if re.match("[\w.]+@[\w.]+:+", line):
            email_list.append(line)

with open("email_dump.txt", "w")as f:
    for email in email_list:
        f.write(email+"\n")
                
print("[*] Wrote {} Emails and Passwords to email_dump.txt".format(str(len(email_list))))

pastebin-api-python2-3's People

Contributors

lukebob avatar

Stargazers

 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.