Skip to content

Instantly share code, notes, and snippets.

@ycaty
ycaty / google_results_script.py
Created April 9, 2023 02:12
scraping google results exactly getting the number of search results for each keyword in csv
import requests
import csv
from bs4 import BeautifulSoup
# Read the keywords from a file
with open("keywords.txt", "r") as file:
keywords = file.read().splitlines()
# Define the User-Agent header
headers = {
from random import randint
from uuid import uuid4
import pickle
import time
from hands.ip_wait_change import ip_change_wait
import json
from termcolor import colored
from pygments import highlight
from pygments.formatters.terminal import TerminalFormatter
from pygments.lexers.web import JsonLexer
@ycaty
ycaty / colorful_json_print.py
Created September 13, 2022 16:30
print colorful json
from pygments import highlight
from pygments.formatters.terminal import TerminalFormatter
from pygments.lexers.web import JsonLexer
dict = {'123':{'cats':6,'dogs':0}}
raw_json = json.dumps(dict , indent=4)
colorful_json = highlight(
raw_json,
lexer=JsonLexer(),
@ycaty
ycaty / client.py
Created September 13, 2022 14:25
Simple Client/Server Sockets
# https://gist.github.com/ycaty
import json
from uuid import uuid4
import socket
import time
HOST = "127.0.0.1"
PORT = 65432
@ycaty
ycaty / windows 10 turn on auto login without password
Last active August 25, 2022 17:51
windows 10 turn on auto login without password
If you're unable to view "users must enter a username and password to use this computer"
after running "netplwiz" from run dialog.
1)
# RUN THIS ADMIN POWERSHELL
New-ItemProperty -Path “HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device” -Name DevicePasswordLessBuildVersion -Value 0 -Type Dword –Force
2)
# NEXT OPEN RUN DIALOG AND ENTER..
@ycaty
ycaty / instagram_login.py
Last active October 2, 2021 10:26
Simple python 2.7 script for logging into instagram 2021
import requests
import time
import random
username = 'your_username_here'
password = 'your_password_here'
def default_headers():
return {
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36',
Instagram scraping user tags 2020
Brief demonstration on how to scrape and collect user tags without needing login information.
A lot of data end points such as "viewing followers" is blocked by public users(not logged in).
This is a way to bypass one of these endpoints.
Scrape user tags (same as the url) -> instagram.com/username/tagged
https://www.instagram.com/graphql/query/?query_hash=31fe64d9463cbbe58319dced405c6206&variables={"id":"29883180","first":12}
Url Breakdown