Skip to content

Instantly share code, notes, and snippets.

View Ra1d7's full-sized avatar
🛌
Focusing

Moath Altarawneh Ra1d7

🛌
Focusing
View GitHub Profile
@Ra1d7
Ra1d7 / WebScraping.py
Created February 6, 2017 17:03
scrape nytimes.com for titles and print them
import requests
from bs4 import BeautifulSoup
r = requests.get('http://www.nytimes.com')
soup = BeautifulSoup(r.text,'lxml')
for story_heading in soup.find_all(class_="story-heading"):
try:
string = story_heading.a.text.replace(" ",'')
string = string.replace('\n','')
print(string)
except:
@Ra1d7
Ra1d7 / CowsAndBulls.py
Last active February 6, 2017 17:28
play cows and bulls game!
from random import randint
cows = 0
bulls = 0
ONE = randint(1,9)
TWO = randint(1,9)
THREE = randint(1,9)
FOUR = randint(1,9)
sec_num = str(ONE) + str(TWO) + str(THREE) + str(FOUR)
while True:
bulls = cows = 0
prime = open(r'C:\Users\Raid7\Desktop\prac\primenumbers.txt')
happy = open(r'C:\Users\Raid7\Desktop\prac\happynumbers.txt')
primes = prime.readlines()
happy = happy.readlines()
for num in primes:
if num in happy:
print(num)
@Ra1d7
Ra1d7 / cows and bulls.py
Created August 24, 2019 21:30
PracticePython.org
import random
num = []
numtoguess=0
cows=0
bulls=0
for i in range(0,4):
num.append(random.randint(0,9))
numtoguess = int('{}{}{}{}'.format(num[0],num[1],num[2],num[3]))
def doguess():
global cows
import random
long = input('Please enter how long you want your password to be :')
withsym = input('Do you want symbols in your password?(Y/N): ')
passwd = []
passe=''
def dorand():
global passwd
if withsym.lower() == 'y':
type = random.randint(0, 3)
import random
long = input('Please enter how long you want your password to be :')
withsym = input('Do you want symbols in your password?(Y/N): ')
passwd = []
passe=''
def dorand():
global passwd
if withsym.lower() == 'y':
type = random.randint(0, 3)
words = input('String to reverse: ').split(' ')
reverselist = []
reversestring=''
numofwords = len(words)-1
for x in range(0,numofwords):
reverselist.append(words[numofwords-x])
reverselist.append(words[0])
for item in reverselist:
reversestring += ' ' + item
print(reversestring)
@Ra1d7
Ra1d7 / fbmkr.py
Created August 28, 2019 18:49
Facebook Mass Account Maker
import mechanize
import requests
import re
import logging
import argparse
import sys
reload(sys)
sys.setdefaultencoding('utf8')
@Ra1d7
Ra1d7 / ShortenUrl.py
Created August 28, 2019 19:48
Shorten URL or a file with URLS
import requests
import os
def clearscreen():
print('\n'*50)
links = []
print('''==== Welcome To ezme.ir URL shortener ====
========= Coded By: Raid7 =========
''')
fileorurl = input('(F)ile or (U)rl?: ').lower()
ProcessThis = input('File or URL to shorten: ')
@Ra1d7
Ra1d7 / SimpleEncryption.py
Last active September 15, 2019 03:47
Simple Encryption and Decryption Using a dictionary and keys
chars = {
'!':-15,
'"':-14,
'=':-13,
'+':-12,
'-':-11,
'*':-10,
'#':-9,
'$':-8,
'%':-7,