This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf8 | |
xml = '''<?xml version="1.0" encoding="UTF-8"?> | |
<soft> | |
<os> | |
<item name="linux" dist="ubuntu"> | |
This text about linux | |
</item> | |
<item name="mac os"> | |
Apple company |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from lxml import html | |
#~ response = requests.get('https://www.yahoo.com/news/') | |
#~ parsed_body = html.fromstring(response.text) | |
responsetext='<ul><li><span>Model No.:</span><em>CN-374181929</em></li><li><span>Material:</span><em>ABS</em></li><li><span>Product Size:</span><em>4.5cm</em></li><li><span>Product Weight:</span><em>0.053kg</em></li><li><span>Features:</span><em>Phthalates Free</em></li><li></li><li><span>Package Size:</span><em>13*7.5*4.9cm</em></li><li><span>Package Weight:</span><em>0.072kg</em></li><li><span>Package Type:</span><em>colorbox</em></li><li></li><li><span>QTY/CTN:</span><em>160PCS</em></li><li><span>Case Size:</span><em>58.5*43*40cm</em></li><li><span>N.W:</span><em>8.5kg</em></li><li><span>G.W:</span><em>10.5kg</em></li><li><span>Volume:</span><em>0.1CBM</em></li></ul>' | |
parsed_body = html.fromstring(responsetext) | |
data = parsed_body.xpath(".//li") | |
print len(data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#~ How to upload image to imgur as a specific user | |
#~ https://api.imgur.com/endpoints/image#image-upload | |
client_id = '152n90e218cakme' | |
access_token ='07566baa9e20c57e71203191dde1daffc6250ad3' | |
#~ Get Access token from : from imgurpython import ImgurClient ;) | |
import urllib2 | |
import urllib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#~ Перезагрузка Dlink DIR-100 скриптом How to Reboot Your Router Dir-100 restart telnet | |
import requests | |
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1'} | |
session = requests.Session() | |
content=session.post('http://192.168.1.1/login.htm', { | |
'uname': 'admin', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! python2 | |
# //coding: utf-8 | |
# coding=utf-8 | |
''' | |
http://pickpoint.ru/sales/ | |
Тестовая версия https://e-solution.pickpoint.ru/apitest/ | |
Логин: apitest | |
Пароль: apitest | |
ИКН: 9990003041 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! python2 | |
# //coding: utf-8 | |
''' | |
29 april 2018 http://ws.dpd.ru:80/services/tracing?wsdl | |
Проверка и нормализация адреса с помощью SoapUI, подробно https://otpravka.pochta.ru/specification#/usecases-soapui-clean_address | |
Скачайте и установите SoapUI | |
1 шаг: Скачайте и установите SoapUI | |
-1. Перейдите по ссылке SoapUI. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python.exe | |
# coding=utf-8 | |
# vim: set fileencoding=utf-8 : | |
#~ print "Content-Type: text/html\r\n" | |
''' | |
надо | |
Установка статуса (SET_STATUS) | |
Изменение фотографий и фотоальбомов (PHOTO_CONTENT) | |
Доступ к основной информации (VALUABLE_ACCESS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# boostrap nested npm modules installation | |
npm-boot() { | |
local INIT_DIR=$PWD | |
# go through all packages and install their dependencies | |
for package in `ls ./**/package.json | grep -v node_modules` | |
do | |
cd $INIT_DIR | |
cd $(dirname $package) | |
echo "Installing modules for $PWD" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! python2 | |
# //coding: utf-8 | |
# coding=utf-8 | |
# -*- coding: utf-8 -*- | |
# vim: set fileencoding=utf-8 : | |
a = u'1a' | |
a = a.decode('utf-8').encode('cp1251') | |
print a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
базовые команды | |
git clone адрес репозитория - клонировать репозиторий на локальный компютер | |
git commit -m 'initial commit' комит изменений в локальный репозиторий | |
git push -u origin master - только первый раз отправка изменений в удаленный репозиторий | |
git push - все последующие разы отправка изменений в удаленный репозиторий | |
окат изменений | |
git pull - скачивается актуальная версия удаленного репозитория и все изменения применяются к локальному репозиторию | |
checkout - перейти в другую ветку | |
discard - не отправлять в репозиторий те изменения которые нам не нравятся |
OlderNewer