Skip to content

Instantly share code, notes, and snippets.

View andrealmar's full-sized avatar
🏠
Working from home

Andre Almar andrealmar

🏠
Working from home
View GitHub Profile
FROM ubuntu
MAINTAINER Andre Almar <[email protected]>
# Add the PostgreSQL PGP key to verify their Debian packages.
# It should be the same key as
# https://www.postgresql.org/media/keys/ACCC4CF8.asc
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
# Add PostgreSQL's repository. It contains the most recent stable release
def imprime_primeiro_item(lista_de_items):
print(lista_de_items[0])
"""
This code snippet do the following:
- It grabs the last 100 tweets from 10 users
- saves the tweets in .csv format inside the CSV directory (it creates the CSV directory if it not exists)
"""
import sys, os
import csv
import tweepy
from tweepy import OAuthHandler
from __future__ import absolute_import, unicode_literals
from celery import current_app
from celery.bin import worker
if __name__ == '__main__':
app = current_app._get_current_object()
worker = worker.worker(app=app)
import logging
import os
from time import time
from download import setup_download_dir, get_links, download_link
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
import json
import logging
import os
from pathlib import Path
from urllib.request import urlopen, Request
logger = logging.getLogger(__name__)
types = {'image/jpeg', 'image/png'}
import logging
import os
from queue import Queue
from threading import Thread
from time import time
from download import setup_download_dir, get_links, download_link
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
import logging
import os
from functools import partial
from multiprocessing.pool import Pool
from time import time
from download import setup_download_dir, get_links, download_link
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
import logging
import os
from redis import Redis
from rq import Queue
from download import setup_download_dir, get_links, download_link
import logging
import os
from time import time
import asyncio
import aiohttp
from download import setup_download_dir, get_links
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')