Exemplo n.º 1
0
 def __init__(self):
     mongodb_settings = config.setting("mongodb")
     connection = pymongo.MongoClient(mongodb_settings["host"],
                                      mongodb_settings["port"])
     db = connection[mongodb_settings["db"]]
     collection = db["Subject"]
     # Build indices
     collection.create_index([("subjectType", pymongo.ASCENDING)])
     collection.create_index([("title", pymongo.ASCENDING)])
     collection.create_index([("fullTitle", pymongo.ASCENDING)])
     collection.create_index([("imdb", pymongo.ASCENDING)])
     collection.create_index([("py_url", pymongo.ASCENDING)])
     self.collection = collection
Exemplo n.º 2
0
 def __init__(self):
     mongodb_settings = config.setting("mongodb")
     connection = pymongo.MongoClient(
         mongodb_settings["host"],
         mongodb_settings["port"]
     )
     db = connection[mongodb_settings["db"]]
     collection = db["Subject"]
     # Build indices
     collection.create_index([ ("subjectType", pymongo.ASCENDING) ])
     collection.create_index([ ("title", pymongo.ASCENDING) ])
     collection.create_index([ ("fullTitle", pymongo.ASCENDING) ])
     collection.create_index([ ("imdb", pymongo.ASCENDING) ])
     collection.create_index([ ("py_url", pymongo.ASCENDING) ])
     self.collection = collection
Exemplo n.º 3
0
import magic
import pydeep
import requests
from cybox.common import Hash
from cybox.core import Observable
from cybox.objects.file_object import File
from stix.coa import CourseOfAction
from stix.common.kill_chains.lmco import PHASE_DELIVERY
from stix.core import STIXHeader, STIXPackage
from stix.data_marking import Marking, MarkingSpecification
from stix.extensions.marking.simple_marking import SimpleMarkingStructure
from stix.extensions.marking.tlp import TLPMarkingStructure
from stix.indicator import Indicator
from stix.ttp import TTP

SETTINGS = setting("config.json")
BUF_SIZE = SETTINGS['buffer_size']


def _construct_headers():
    headers = {'Content-Type': 'application/xml', 'Accept': 'application/json'}
    return headers


def _inbox_package(endpoint_url, stix_package):
    headers = _construct_headers()
    response = requests.post(endpoint_url, data=stix_package, headers=headers)
    print("HTTP status: %d %s") % (response.status_code, response.reason)
    return

#!/usr/bin/env python3

from datetime import datetime as dtime
import os
import sys
import scraperLibrary
import daumMovieTitleScraper
import config

if __name__ == '__main__':

    setting = config.setting()
    setting.loadJson()
    movie = config.Moive(setting)

    movieTitleScraper = daumMovieTitleScraper.SiteScraper(setting)

    if not movieTitleScraper.checkUrl():
        print("info, main scraper.checkUrl = false")
        sys.exit()

    movieTitles = movieTitleScraper.getParseData()
    # <strong class="tit_join"><a class="link_g #list #monthly @1" href="/moviedb/main?movieId=111292">기생충</a></strong>, ...
    #print("info, main titles_tag = ", titles_tag)

    f = open(movie.fileName, 'a', encoding="utf-8")

    for index, movieTitle in enumerate(movieTitles, start=1):

        title = movieTitle.text
        print(title)
Exemplo n.º 5
0
import magic
import pydeep
import requests
from cybox.common import Hash
from cybox.core import Observable
from cybox.objects.file_object import File
from stix.coa import CourseOfAction
from stix.common.kill_chains.lmco import PHASE_DELIVERY
from stix.core import STIXHeader, STIXPackage
from stix.data_marking import Marking, MarkingSpecification
from stix.extensions.marking.simple_marking import SimpleMarkingStructure
from stix.extensions.marking.tlp import TLPMarkingStructure
from stix.indicator import Indicator
from stix.ttp import TTP

SETTINGS = setting("config.json")
BUF_SIZE = SETTINGS['buffer_size']


def _construct_headers():
    headers = {
        'Content-Type': 'application/xml',
        'Accept': 'application/json'
    }
    return headers


def _inbox_package(endpoint_url, stix_package):
    headers = _construct_headers()
    response = requests.post(endpoint_url, data=stix_package, headers=headers)
    print("HTTP status: %d %s") % (response.status_code, response.reason)