Python to gather news postings

#coded by sk for me.
# -*- coding: utf-8 -*-
import re
import requests
import numpy

url = ‘http://www.krcert.or.kr/data/secNoticeList.do’
recvd = requests.get(url)

print ‘#’*50
print ‘KISA’ + ‘#’*20
tbody = re.findall(r’

.+?

‘, recvd.text, re.DOTALL)
for line in tbody:
# print line
temp = re.findall(r’(.+?)‘,line)
temp_date = re.findall(r’2016.[1-9][0-9].[1-9][0-9]’,line)
try:
for i in range(0, 20, 1):
print temp[i],temp_date[i]
A = ((temp[i], temp_date[i]))

except:
print ‘done’
# for line2 in temp:
# temp_date = re.findall(r’2016.[1-9][0-9].[1-9][0-9]’,line)
# print temp_date
# for line3 in temp_date:
# print line2
# for line2 in temp:
# temp2 = re.findall(r’

2016.[0-9][0-9].[0-9][0-9]

‘, temp)
# print line2
print ‘#’*30
print ‘USCert’ + ‘#’*20
url = ‘https://www.us-cert.gov/ncas/current-activity.xml’
recvd = requests.get(url)
tbody = re.findall(r’.+?’, recvd.text, re.DOTALL)
for line in tbody:
# print line
temp_date = re.findall(r'(.+?)’,line)
temp = re.findall(r'(.+?)’,line)
print temp[0],temp_date[0]
# temp_date = re.findall(r’2016.[1-9][0-9].[1-9][0-9]’,line)
print ‘#’*30
print ‘Krebs’ + ‘#’*20
url = ‘https://krebsonsecurity.com/feed/’
recvd = requests.get(url)
tbody = re.findall(r’.+?’, recvd.text, re.DOTALL)
for line in tbody:
# print line
temp_date = re.findall(r'(.+?)’,line)
temp = re.findall(r'(.+?)’,line)
print temp[0],temp_date[0]

print ‘#’*50
print ‘KB-UScert’ + ‘#’*20
url = ‘https://www.kb.cert.org/vulfeed’
recvd = requests.get(url)
tbody = re.findall(r’.+?’, recvd.text, re.DOTALL)
#print tbody
for line in tbody:
# print line
temp = re.findall(r'(.+?)’,line)
temp_date = re.findall(r'(.+?)’,line)
print temp[0],temp_date[0]

print ‘#’*30
print ‘USCert Alert’ + ‘#’*20
url = ‘https://www.us-cert.gov/ncas/alerts.xml’
recvd = requests.get(url)
tbody = re.findall(r’.+?’, recvd.text, re.DOTALL)
for line in tbody:
# print line
temp_date = re.findall(r'(.+?)’,line)
temp = re.findall(r'(.+?)’,line)
print temp[0],temp_date[0]

print ‘#’*30

Advertisements

Author: SK,Seo

Me! Name: SK Seo

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s