Skip to content

Instantly share code, notes, and snippets.

View kadnan's full-sized avatar
📢
Working from home

Adnan Siddiqi kadnan

📢
Working from home
View GitHub Profile
@kadnan
kadnan / producer-raw-recipies.py
Created June 10, 2018 11:38
methods to access recipes listing and extract markup
def fetch_raw(recipe_url):
html = None
print('Processing..{}'.format(recipe_url))
try:
r = requests.get(recipe_url, headers=headers)
if r.status_code == 200:
html = r.text
except Exception as ex:
print('Exception while accessing raw html')
print(str(ex))
import json
from time import sleep
from bs4 import BeautifulSoup
from kafka import KafkaConsumer, KafkaProducer
def publish_message(producer_instance, topic_name, key, value):
try:
key_bytes = bytes(key, encoding='utf-8')
@kadnan
kadnan / consumer-notification.py
Created June 10, 2018 18:54
Consumer that notifies if calories count cross the threshold
import json
from time import sleep
from kafka import KafkaConsumer
if __name__ == '__main__':
parsed_topic_name = 'parsed_recipes'
# Notify if a recipe has more than 200 calories
calories_threshold = 200
@kadnan
kadnan / cl2.py
Created October 13, 2018 10:01
Anti Captcha test
import requests
from bs4 import BeautifulSoup
from python_anticaptcha import NoCaptchaTaskProxylessTask, AnticaptchaClient
def get_token(s_key):
client = AnticaptchaClient(api_key)
task = NoCaptchaTaskProxylessTask(website_url=url,
website_key=s_key.strip())
job = client.createTask(task)

Keybase proof

I hereby claim:

  • I am kadnan on github.
  • I am kadnan (https://keybase.io/kadnan) on keybase.
  • I have a public key ASAHNs8LV2Ck6XIFQPi-XKiD1amTKsrvPY8RTrvsBr13lwo

To claim this, I am signing this object:

@kadnan
kadnan / docker-compose.yaml
Last active May 15, 2019 09:01
Docker compose file for running Cassandra Cluster
version: '2'
services:
cas1:
container_name: cas1
image: cassandra:latest
volumes:
- /Development/PetProjects/CassandraTut/data/node1:/var/lib/cassandra/data
ports:
- 9042:9042
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"ticket_data": {
"fduid": 47052829709,
"fdcompanyid": 47001498172,
"subject": "#33644| Website Work-> Webpages: Podcast Takeover (Healthcare Amplified-Sabrina Runbeck)",
"status": 10,
"source": 2,
"body": "please build out this sales page \n the first half of the sentence make it like a moving word similar to what you did for this heading https://www.pulsepointvisibilityengine.com/podamplify \n   \n see design page 1 & 2 are continouation of each other and FAQs make them when click down then will show the words \n https://drive.google.com/drive/folders/1psqA7OxK35CgT2ijyH0kEGycLp19CFzb?usp=drive_link Which page needs updating?     build out sales page What platform is this site built on?     go.hilevel Please provide the meta-keywords     \nShort-tail Keywords:\n\nPodcast series\nHealthcare authority\nPodcast takeover\nHealthcare business podcast\nPharma leaders podcast\nClinical practice podcast\n\nLong-tail Keywords:\n\nElevate healthcare expertise th