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
# post to AmCAT | |
> amcat.upload.articles(conn, project=29, articleset=11964, | |
+ author=d$Auteur, | |
+ headline="twitter", | |
+ text=d$Bericht.tekst, | |
+ date=d$datum, | |
+ medium="twitter", | |
+ length=d$Volgers) | |
Error in .amcat.post(conn, path, data = json_data) : | |
Server returned 'HTTP/1.1 403 FORBIDDEN', expected status 201 |
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
set2 = ArticleSet.objects.get(pk=17307) | |
lijst=[] | |
rij=() | |
for row in reader: | |
aid = int(row[0]) | |
medium = int(row[2]) | |
setid = int(row[1]) | |
rij=(aid) | |
if medium is not (4,5,6,7,8,9,11,32): |
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 amcatclient import AmcatAPI | |
import requests | |
import re | |
from urlparse import urljoin | |
from locale import setlocale | |
#setlocale(locale.LC_ALL, "nl_NL.utf8") | |
MONTHS = {"okt": "oct", "maa": "mar", "mei": "may"} |
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 lxml import html, etree | |
import urllib | |
import csv | |
import sys | |
import locale, time, datetime | |
from amcatclient import AmcatAPI | |
import requests | |
import re | |
from urlparse import urljoin | |
from itertools import count |
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
$ prodigy dataset test | |
✨ Successfully added 'test' to database SQLite. | |
$ prodigy db-in test issues3.jsonl | |
✨ Imported 1247 annotations for 'test' to database SQLite | |
Added 'accept' answer to 1247 annotations | |
Session ID: 2018-05-22_21-44-48 |
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 lxml import html | |
import requests | |
import csv | |
import sys | |
import json | |
from amcatclient import AmcatAPI | |
import urllib | |
from lxml.html import fromstring | |
import time | |
from urllib.request import Request, urlopen |
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 | |
url = 'https://www.jancisrobinson.com/tastings/search?perpage=100&page=1' | |
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'} | |
response = requests.get(url, headers=headers) | |
print(response.content) |
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 django | |
django.setup() | |
from amcat.models import Article,Project, CodingJob, CodingSchemaField, ArticleSet | |
import sys, datetime, csv | |
cjs = list(CodingJob.objects.filter(project__id=1)) | |
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 urllib.request | |
import json | |
url = 'https://www.openkamer.org/api/kamervraag/?format=json&offset=1' | |
req = urllib.request.Request(url) | |
##parsing response | |
r = urllib.request.urlopen(req).read() | |
cont = json.loads(r.decode('utf-8')) |
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 urllib.request | |
import json | |
import amcatclient | |
from amcatclient import AmcatAPI | |
URL_TEMPLATE = 'https://www.openkamer.org/api/kamervraag/?limit=10&offset={offset}' | |
def get_json(url): | |
req = urllib.request.Request(url) |
OlderNewer