Skip to content

Instantly share code, notes, and snippets.

console.log("---> Running");
const curl = require("curl");
const jsdom = require("jsdom");
const url = "http://www.imdb.com/list/ls004489992/";
curl.get(url, null, (err,resp,body)=>{
if(resp.statusCode == 200){
parseData(body);
}
import requests
from bs4 import BeautifulSoup
import time
USER_AGENT = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36'}
def fetch_results(search_term, number_results, language_code):
assert isinstance(search_term, str), 'Search term must be a string'
assert isinstance(number_results, int), 'Number of results must be an integer'
@ra2003
ra2003 / 00_inn.md
Created February 22, 2020 17:40 — forked from nalgeon/00_inn.md
Определить ИНН по паспортным данным человека

Определить ИНН по паспортным данным человека

В поддержку «Дадаты» часто обращаются с вопросом «как получить ИНН по паспортным данным». Налоговая служба предоставляет такой сервис, но без API.

В интернете есть несколько сайтов, которые предоставляют сервис «узнать ИНН» через API. Насколько нам известно, все они используют «неофициальный» интерфейс взаимодействия с налоговой, потому что ни официального API, ни открытых данных по ИНН не существует.

Мы в «Дадате» не хотим подключать неофициальное API налоговой: оно не отличается стабильностью работы и имеет непонятные перспективы. Если вы очень хотите получать ИНН через API — вызывайте API налоговой напрямую. Мы подготовили примеры, как это сделать на самых популярных языках — Python, PHP и JavaScript.

API налоговой бесплатное, но используете его вы на свой страх и риск. Никто не гарантирует, что оно будет работать корректно и стабильно.

@ra2003
ra2003 / .zshrc
Created February 20, 2020 17:41 — forked from zserge/.zshrc
autoload -U compinit colors vcs_info
colors
compinit
REPORTTIME=3
HISTFILE=~/.zhistory
HISTSIZE=5000
SAVEHIST=5000
setopt INC_APPEND_HISTORY
setopt EXTENDED_HISTORY
@ra2003
ra2003 / test.py
Created February 16, 2020 20:25 — forked from christianroman/test.py
Bypass Captcha using 10 lines of code with Python, OpenCV & Tesseract OCR engine
import cv2.cv as cv
import tesseract
gray = cv.LoadImage('captcha.jpeg', cv.CV_LOAD_IMAGE_GRAYSCALE)
cv.Threshold(gray, gray, 231, 255, cv.CV_THRESH_BINARY)
api = tesseract.TessBaseAPI()
api.Init(".","eng",tesseract.OEM_DEFAULT)
api.SetVariable("tessedit_char_whitelist", "0123456789abcdefghijklmnopqrstuvwxyz")
api.SetPageSegMode(tesseract.PSM_SINGLE_WORD)
tesseract.SetCvImage(gray,api)
print api.GetUTF8Text()
@ra2003
ra2003 / pyqt5_qwebengineview.py
Created February 7, 2020 11:38 — forked from sergeyfarin/pyqt5_qwebengineview.py
Example of using Python, PyQt5 and QtWebEngineView to open local html file (+js, css). test.html and test.js should be in html subfolder
# coding: utf-8
import sys
import os
# import site
# site.addsitedir('/usr/local/lib/python2.7/site-packages')
from PyQt5 import QtCore, QtWidgets, QtWebEngineWidgets
app = QtWidgets.QApplication(sys.argv)
view = QtWebEngineWidgets.QWebEngineView()
@ra2003
ra2003 / pug.md
Created February 3, 2020 11:33 — forked from neretin-trike/pug.md
Туториал по HTML препроцессору Pug (Jade)
@ra2003
ra2003 / models.py
Created January 30, 2020 13:29 — forked from amirrpp/models.py
from django.db import models
class AbstractSeoContent(models.Model):
h1 = models.CharField('H1', max_length=255, blank=True)
meta_title = models.CharField(_('Title for page'), max_length=255, blank=True)
meta_description = models.CharField(max_length=255, blank=True)
meta_canonical = models.CharField(max_length=255, blank=True)
meta_keywords = models.CharField(max_length=255, blank=True)
meta_robots = models.CharField(max_length=255, blank=True)
@ra2003
ra2003 / ckedit.py
Created January 29, 2020 20:31 — forked from dengshuan/ckedit.py
Apply ckeditor(WYSIWYG rich text editor) to flask-admin textarea
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext import admin
from wtforms import TextAreaField
from wtforms.widgets import TextArea
from flask.ext.admin.contrib.sqla import ModelView
app = Flask(__name__)
app.config['SECRET_KEY'] = '123456790'
@ra2003
ra2003 / Makefile
Created January 29, 2020 17:38 — forked from lumengxi/Makefile
Makefile for Python projects
.PHONY: clean-pyc clean-build docs clean
define BROWSER_PYSCRIPT
import os, webbrowser, sys
try:
from urllib import pathname2url
except:
from urllib.request import pathname2url
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
endef