Russia is threatening the "liberal international order": Biden went after Putin directly, and said he's using "every tool" in his power to whittle away at Europe and undermine Western democracies. Biden also warned that he expects Russia to meddle in the many European elections being held later this year. \n\n\n**"The top 1% is not carrying their weight"****: Steps must be taken to close the rift between those "racing ahead at the top" and those "struggling to hang on in the middle." \n\nBeware emerging demagogues and autocrats: They're seeking to capitalize on people's insecurities. Biden discussed the rising popular movements across the world, and said they demonstrate a dangerous willingness to revert to political small-mindedness. "In this case, using Islamophobic, anti-Semitic, or xenophobic rhetoric to stoke fear, sow division, and advance their own narrow agendas" offers only a false sense of security. \n\nDavos tell us how you really feel:** a nice detail from the pool report by Steve
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
import requests | |
from operator import itemgetter | |
url = 'http://smt.qa.mail.ru/stands.json' | |
r = requests.get(url) | |
result = r.json() | |
for stand in result: |
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
{"count": 4, "slideshows": [{"created_ts": 1479458066, "user_id": 7, "title": "Fifth slideshow", "site_id": 6, "slides": [{"is_animated_gif": false, "description": "", "manual_image_crops": {}, "title": "", "media": "https://s3.amazonaws.com/dev-assets.rbl.ms/medvedev/495/980x.jpg", "media980x": "https://s3.amazonaws.com/dev-assets.rbl.ms/medvedev/495/980x.jpg", "media600x": "https://s3.amazonaws.com/dev-assets.rbl.ms/medvedev/495/600x.jpg", "video_shortcode": null, "tracking_code": "", "credit": "", "media210x": "https://s3.amazonaws.com/dev-assets.rbl.ms/medvedev/495/210x.jpg", "image_in_library": false, "video_embed": null, "media_type": 1, "media300x": "https://s3.amazonaws.com/dev-assets.rbl.ms/medvedev/495/300x.jpg", "id": "gkFSlR", "media35x35": "https://s3.amazonaws.com/dev-assets.rbl.ms/medvedev/495/35x35.jpg", "thumb": "https://s3.amazonaws.com/dev-assets.rbl.ms/medvedev/495/35x35.jpg"}, {"is_animated_gif": false, "description": "", "manual_image_crops": {}, "title": "", "media": "https://s3.amazona |
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
from stats.abstract_factory import StatsFactory | |
from community.models import Site | |
from roar.posts.models import Post | |
site = Site.objects.get_by_id(376394) | |
stats_api = StatsFactory().make_real_instance().make_dynamic_content_api() | |
popular_articles_ids = stats_api.get_site_top_post_id_list_for_last_hour(site.id, limit=5) | |
print popular_articles_ids | |
# [2063523886L, 1442440440L, 2066492082L, 2066734997L, 2066743186L] |
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
import scrapy | |
from scrapy.contrib.spiders import CrawlSpider, Rule | |
from scrapy.contrib.linkextractors import LinkExtractor | |
from scrapper.items import ModelItem, DjangoCarModel, DjangoCarBrand | |
class CarModelSpider(CrawlSpider): | |
name = 'car_models' | |
allowed_domains = ['drom.ru'] | |
start_urls = ['http://auto.drom.ru'] |
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
<div class="article-media"> | |
<script src="https://mssl.fwmrm.net/p/ddn_live/AdManager.js"></script> | |
<video id="rev3-player" class="mejs-rev3" width="100%" height="auto"></video> | |
<script type="text/javascript"> | |
adConfig.revision3_video_id = "78879"; | |
var r3player, streamSense; | |
require(['jquery'], function($) { | |
var sourceDomain = "https://statics.revision3.com/ui/sk/"; | |
var url = "http://api.seekernetwork.com/api/getNetworkMasher.json?network=seekernetwork.com&api_key=dfca5770763ffa67f79787533ec16b9ad75c72e5"; |
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
def insert_mid_related_articles(content, urls): | |
soup = bs4.BeautifulSoup(content, 'html.parser') | |
paragraphs = soup('p') | |
words_count = 0 | |
if len(paragraphs) > 1: | |
for p in paragraphs: | |
words = filter(bool, re.split('\W+', p.string)) | |
words_count += len(words) | |
if words_count > 300: | |
middle = len(paragraphs) / 2 |
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
from ma import Second | |
class B(Second): | |
def __init__(self, _): | |
pass | |
@staticmethod | |
def fnc(a, b): |
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
class Parent(object): | |
pass | |
class MyError(Exception): | |
pass | |
class isSecondField(object): | |
def __init__(self, value): | |
self.value = value |
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
import bs4 | |
import os | |
import requests | |
import re | |
import SimpleHTTPServer | |
import SocketServer | |
from cStringIO import StringIO | |
PORT = 8000 |