twitter hacking
kind of because if you think we're going
to be hacking into twitter or hacking
into someone's account we're not doing
that so if you're here for that get out
of here not the video for you but we
will be using this amazing python
hacking tool to gather information from
twitter this tool is crazy powerful no
rate limit no login no api the setup is
super fast it seriously takes seconds
and i'll show you how to use this tool
via cli and even how to import this into
your python code now real quick
disclaimer while the tool we're using is
not illegal and the way it searches
twitter is not illegal your intent does
matter please do not hack anyone without
their permission or use this tool with
any kind of ill intent so be careful use
it for educational purposes only the
hacking tool we're using is called twint
which stands for twitter intelligence
and seriously no joke i've never had
more fun playing with a hacking tool
like i spent way too much time playing
with this so i'm crazy excited to show
you this for real and it's super crazy
easy to set up all you'll need is about
five minutes you can use any linux
computer and of course i'll show you how
to get free access to google cloud
console which is my preferred way to do
all this completely free like you can
start using this tool right now in five
minutes
all you need is your web browser i love
that so much anyways and then last but
certainly not least i need some coffee
man you need some hacking fuel two cups
minimum networkchuck.coffee if you don't
already have some
let's get started oh wait hold on real
quick have you hacked the youtube
algorithm today make sure you do hit
that like button subscribe notification
bell comment let's hack youtube today
ethically of course now again i'll be
demoing this on the google cloud console
which is completely free and amazing you
can do it right now i've got a link
below in the description just click that
sucker and go now of course you can use
your own environment that's fine too the
steps will be the same so i'm gonna get
signed into my google cloud console and
get this party started i'm so excited
once you're logged in click on the cloud
console icon at the very top right here
and that'll launch your cloud shell and
it's so cool again i can't say it enough
thank you google for doing something
like this now real quick if you're not
using google cloud console like me you
will need a few things installed like
apt install git
do that apt install
python 3 do that and apt install python3
dash pip and that should be enough let's
keep going first command we're going to
use git to clone our tool now i will
have all these commands below in the
description feel free to copy and paste
but typing it in feels so much better
just do that anyways git clone
we'll do a dash dash depth equals one
and then the url to the project it'll be
https colon whack whack and the url and
hit enter
it's gonna clone that sucker done so
fast then we're gonna change directories
into the twent directory that we just
downloaded cd twin
there and then last command to get this
going we're gonna install our
requirements so pip three
install we'll do a space then a dot and
then a space dash r
requirements
dot txt and hit enter
coffee break
and while we're all sipping our coffee
i'd like to thank the sponsor of this
video skillshare skillshare is an online
learning community with a ton of classes
like over a thousand thousands now what
i love about skillshare is that it's not
necessarily about i.t it's more about
creative stuff like how to make coffee
yeah there's a course on that or how to
develop my already excellent drawing
skills i mean i think it's pretty
obvious that i don't need any more help
i'm already pretty dang good so i'll
check out that course and see if they
can teach me anything i doubt it so be
watching the channel see if i improve my
drawing skills but seriously i do think
it's important that i.t people like us
explore the soft skills side of our
skill sets learning things like hey how
do i talk in front of people public
speaking how do i teach and get an idea
across how do i stay productive like for
example i'm going through thomas frank's
productivity class for creatives it's
these x factor skills that make you
great in i.t and also i do think it's
important that you have hobbies and
interests outside of technology i know
it's kind of hard to because it's
awesome so explore your creative side a
bit learn how to make a cup of coffee
learn how to draw maybe learn how to
make a ui a user interface the pretty
part of it instead of just the back end
so check it out link below in the
description the first 1 000 people to
click that link will get a free trial of
the skillshare premium membership after
that it's only 10 bucks a month anyways
coffee break over let's keep going and
that's it it's installed ready to go
just like that and honestly it's so
simple and cool to use watch this i'm
gonna clear my screen so let's try this
first type in twent
then we'll do a dash u for a username
and we'll specify a user let's say just
myself network chuck
what this tool is doing is so cool no
api required it's not using the twitter
apis
no twitter login required it's simply
scraping twitter and it's crazy powerful
let's try it out right now ready set go
ah
i'm going to hit ctrl c to stop but look
at all that look at all my tweets that
is so stinking cool but this is just the
beginning here we go
let me clear my screen once more now
first real quick how do you get help if
you don't know what you're doing simply
type in twent and then dash h it'll tell
you all the switches you can use now
this way is cool using the cli we'll go
through a few more examples here in a
moment but the more powerful amazing way
to do this the more fun way
is through python modules
or the python module we can import twins
into our code and use it for some cool
stuff i'll show you here in a moment but
anyways the cli is powerful by itself
let's try a few things so let's do that
same search we just did twins
dash u for user name network chuck now
what if you don't want a million tweets
what if you only want my last 20 tweets
we can do that dash dash limit
to the last 20 tweets that's more
digestible let's try that out real quick
okay there we go not too bad you can
also search through tweets so i can do
twin
u for my username network chuck once
more and then we can do a dash s to
search and this can be any keyword for
example we may want to see all the
raspberry pi tweets i put out
so put raspberry pi between quotes and
let's take a look
it even has my first tweet about
raspberry pi's which was back in 2016.
oh my gosh oh my gosh this is when i put
a unified controller openvpn dynamic dns
all running on my pi 3. that was fun all
right let's keep going let's go deeper
let's get crazier we can also output
these results to a file so we can you
know store them and look at them later
twint will do the same thing network
chuck for my username
i'll search for it every time i've said
right now and then i'll do a dash o
to output it to a file
see right now
dot json and then i'll do a dash dash
json to make sure the data is formatted
to be json now let's check it out
now it'll still output to the terminal
but let's do an ls to see what's inside
my folder here there it is right
now.json let's look inside i'll do a
nano right now.json
and there they all are that is so cool
okay here we go even deeper more cool
things let's pick on david bomble so
twint dash u david bomble
if you don't know who david bomble is go
follow that guy he's amazing we've been
friends for years now i want to see all
david bomble's popular post i'll do dash
dash men dash likes
and i'll do 100 this will return all
tweets that have at least 100 likes if
it doesn't have 100 likes ain't gonna be
there let's try it out
yeah look at david so popular look at
all those
popular tweets let's see all the times
he's talked about me i'll search for
myself
yeah oh it's still going yeah we hang
out a lot we talk a lot
maybe i only want to see his tweets from
today let's try that i'll do dash dash
sense and i'll specify the date 2021
today's april 28th
let's see lil congrats to all these
winners of the contest so just one tweet
today we can also go back and look at
previous stuff like let's specify a year
2016 was david even on twitter yeah he
was wow
[Laughter]
he's talking about sdn and open flow
like crazy now i want to see his
pictures from 2016 so i can actually
specify tweets only with images i'll do
dash dash images here we go oh he's got
one talking about raspberry pi's let's
go take a look at that
oh someone retweeted david and how he's
messing with
a raspberry pi zero that's fun now what
we're doing here might seem silly i'm
just looking at pictures and old tweets
but that's that's hacking gathering
information is a vital part of hacking
now just a few more cli commands before
we go crazy in python so here we go you
don't have to just search by username or
by one account
i can search simply by a search term so
maybe i want to find out all the people
talking about coffee
near where i live here in dallas i can
do that so i'll do dash dash near dallas
and i want to see it for today so i'll
do
sense 2021 blah blah today and these
things have to be popular so i want a
minimum likes
of at least 15 likes let's try it out
that is too cool
six hours straight of drinking coffee
while listening to edm probably not
healthy choice i don't know sounds great
to me maybe i'm in paris and i want to
hang out with people talking about
raspberry pies so let's see if anyone's
talking about raspberry pies today in
paris
and there certainly are let's go check
this guy out real quick raspberry pi
news looks pretty cool and you can also
be more precise so you don't have to do
near
you can actually search by coordinates
by geo coordinates so let's uh specify
some geo coordinates dash g
equals latitude and longitude
i'll do a comma after that and specify
the radius we'll say within like
20 kilometers no one this is austin
texas no one's talking about raspberry
pi's
i bet they're talking about coffee let's
test that out yeah look at all those
coffee people in austin texas
now the cli it's fun but the real power
comes in with python you ready let's do
this this is so cool seriously anyways
here we go i'm going to create a new
python file using nano leave me alone
nano and i'll name this hot topic
nothing to do with the store not
sponsored relax
dot pi
first thing we'll do here is make sure
we got
twint
involved we'll import twint
that's importing that python module so
we can use it in our script so for this
script i want it to be interactive so
here we go i want to be able to launch
this and say hey
this is what i'm searching for and what
city
i'm searching for it in to kind of get
hot topics like maybe raspberry pi's in
dallas coffee in berlin t in england
there you go david let's try it out i'll
name my first variable search
and i'll have that equal
an input it'll ask me for input it'll
ask me what are you searching for
another one i'll name city and equal
that
also an input i'll say where and then
let's get twent set up now this is all
foreign to you that's fine this is a
great opportunity for you to learn a
little bit of python and if you already
know python do you go crazy with this
and have a ton of fun seriously this is
so cool anyways
okay have i said that enough yet so i'll
say c another variable i'll have that
equal
twint.config case being very important
here i'll say c dot search
equals my variable search c dot
near
equals
my variable city i do want to limit my
search so i'll say limit it to 20 tweets
and i only want to see popular tweets
now i can say number of likes like it
has to have 100 likes or i can do
popular
tweets
this is boolean so how they equal
true i believe that is yeah oh wait the
t needs to be lower case
case is important
and yeah you know i think that's good so
now we're going to launch the command
it'll be twint.run.search
and then my variable c which
encapsulates all that business right
here that should be good i'm going to
control x
to get out of there why do you see it
want to save it
easy for me to say and hit enter
cool time to run my script by doing
python3 and then what i name it oh hot
topic hot topic dot pi let's see what
happens
what am i searching for hmm
let's see let's do coffee in berlin
coffee
berlin
how cool is that that's so cool
something about coffee and space i want
to see that tweet let's check it out ooh
a new coffee machine love it okay one
more python thing i want to show you
just to kind of show you the power of
what you can actually do yourself
so on twitter i tweeted two things i
said retweet this and then uh reply to
this that was for right now so i've got
a script let me show you what i'm doing
so here it is let's jump in there real
quick
i called it my people
dot pi and here's the script i'm pulling
in date time to get today's date
now now i'm saying whoever tweets at me
today i want to pull all those tweets
it's going to run that search and then
throw that into a a list a python list
if you don't know what that is we'll
cover some of that stuff later in a new
series i then create a new list just
called my people and that new list with
this command will only have all of your
usernames everyone who replied to me or
or sent me stuff i've got all your
usernames in a nice little list it's
going to print that list
and then it's going to go through all of
your accounts
and pull your last 20 tweets and 20
tweets 10 times fast and then print that
on the terminal
pretty cool right i mean it's kind of
pointless
but if you think about what you can do
for an actual ocean investigation when
you're hacking whatever
so check it out let's try it python3
my people
dot pi here we go ready for this here we
go
there you all are thank you
and then here comes all your tweets
how cool is that
twit a python hacking tool for twitter
it's awesome i can seriously spend hours
just playing with this and creating
scripts in fact i would love to see what
you guys create so let me know below
comment below with what you have that's
awesome anyways let me know you think of
the video in the comments below make
sure you hack youtube today ethically of
course the algorithm so like the video
comment notification bell all that
youtubey stuff and yeah that's all i
have today
i'll catch you next time
[Music]