コード例 #1
0
ファイル: server.py プロジェクト: manicphase/IBIBIBIS
import subprocess
import updateipns
from flask import Flask, Response, request

conn = sqlite3.connect('imagehashes (another copy).db')

c = conn.cursor()

app = Flask(__name__)

db = "4chan.wg.archive.db"

update = raw_input("do you want to search for an up to date database? Y/n ")

if "yY ".find(update) > -1:
    updateipns.update_db(db)


@app.route("/")
def get_stuff(filter=None, filetype=None, start=0):
    try:
        start = int(request.args.get('start'))
        print start
    except:
        pass
    try:
        filter = request.args.get('filter').split(",")
        if len(filter[0]) == 0:
            filter = None
    except:
        pass
コード例 #2
0
ファイル: scraper.py プロジェクト: manicphase/IBIBIBIS
import collections
import sqlite3
import time
import updateipns
import traceback
import time


#board = "wg"
board = raw_input("Which board do you want to scrape? (defaults to wg)")
if board == "":
    board = "wg"

update = raw_input("Would you like to find an existing backup of this board? (Recommended) Y/n")
if "yY ".find(update) > -1:
    updateipns.update_db("4chan.%s.archive.db" % board)

store_db = raw_input("Do you want to store your database once scraping has finished, to allow others to use it? (overwrites ipns) Y/n")
if "yY ".find(store_db) > -1:
    store_db = True
else:
    store_db = False

store_db_p = raw_input("Do you want to store your database periodically, to allow others to use it? (overwrites ipns) Y/n")
if "yY ".find(store_db_p) > -1:
    store_db_p = True
else:
    store_db_p = False

def create_db(board):
    db = "4chan.%s.archive.db" % board
コード例 #3
0
ファイル: server.py プロジェクト: manicphase/IBIBIBIS
import subprocess
import updateipns
from flask import Flask, Response, request

conn = sqlite3.connect('imagehashes (another copy).db')

c = conn.cursor()

app = Flask(__name__)

db = "4chan.wg.archive.db"

update = raw_input("do you want to search for an up to date database? Y/n ")

if "yY ".find(update) > -1:
    updateipns.update_db(db)

@app.route("/")
def get_stuff(filter=None, filetype=None, start=0):
    try:
        start = int(request.args.get('start'))
        print start
    except:
        pass
    try:
        filter = request.args.get('filter').split(",")
        if len(filter[0]) == 0:
            filter = None
    except:
        pass
    hashes = filter