Code Monkey home page Code Monkey logo

pstwitter-media-scraper's Introduction

 _______       _ _   _             __          __  _        _____                                  
|__   __|     (_) | | |            \ \        / / | |      / ____|                                 
   | |_      ___| |_| |_ ___ _ __   \ \  /\  / /__| |__   | (___   ___ _ __ __ _ _ __   ___ _ __   
   | \ \ /\ / / | __| __/ _ \ '__|   \ \/  \/ / _ \ '_ \   \___ \ / __| '__/ _' | '_ \ / _ \ '__|  
   | |\ V  V /| | |_| ||  __/ |       \  /\  /  __/ |_) |  ____) | (__| | | (_| | |_) |  __/ |     
   |_| \_/\_/ |_|\__|\__\___|_|        \/  \/ \___|_.__/  |_____/ \___|_|  \__,_| .__/ \___|_|     
                                                                                | |                
                                                                                |_|                

Click here to view this page in HTML instead of markdown

Requirements

  • Microsoft Windows operating system

        (tested on Windows 10 Version 1909 OS build 18363.720 and Windows Server 2016 Version 1607 OS build 14393.3564)

  • Windows PowerShell, minimum version 3.0

        (tested PowerShell versions 3.0, 5.1.14393.3471, and 5.1.18362.628. I have not tested PowerShell Core.)

  • A Twitter account (username and password)

  • A Twitter page that you would like to srape the media off of

Installation

  • Launch PowerShell and run the code below:
mkdir C:\TEMP\BIN -ea 0
cd C:\TEMP\BIN 
git clone https://github.com/nstevens1040/PSTwitter-Media-Scraper.git 
cd PSTwitter-Media-Scraper 
. .\PSTwitter-Media-Scraper.ps1
  • You can also launch PowerShell and run:
iex (irm "https://raw.githubusercontent.com/nstevens1040/PSTwitter-Media-Scraper/master/PSTwitter-Media-Scraper.ps1")

Either one will make the function Scrape-TWPage available in your current PowerShell session.

Environment Variables

The first time you run Scrape-TWPage you will be asked to set two environment variables:

  1. TWDOWNLOAD : Points to a root folder to store all of your download images and videos.

ScreenShot

  1. EXWEBREQ : Points to a root folder to store any .NET assemblies necessary to use Execute-WebRequest.

ScreenShot

Usage

  1. Scrape-TWPage takes one argument called -TARGET_URI. This is the Uri that takes you to the Twitter page that you would like to scrape the media off of.

    SYNTAX:
    Scrape-TWPage [[-TARGET_URI] <string>] [<CommonParameters>]

  2. A Windows credential dialog appears, asking you to enter the username and password that you use to login to Twitter.

    Your username, password, bearer tokens, and csrf tokens are protected with the System.Security.Cryptography.ProtectedData .NET Framework class which provides access to Microsoft's Data Protection API.

At this point, you are finished entering the information necessary to proceed. The script's output will keep you updated on it's progress.

The steps above are illustrated in the video below. ScreenShot

nstevens1040's github stats
ReadMe Card
Top Langs

pstwitter-media-scraper's People

Contributors

nstevens1040 avatar

Stargazers

 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.