Skip to content

Instantly share code, notes, and snippets.

@fabiobatalha
fabiobatalha / ots.py
Last active April 26, 2018 14:42
OTS rudmentar interface
import os
from json import JSONDecodeError
import requests
OTS_API_HOST = os.environ.get('OTS_API_HOST', 'http://pkp-udev.lib.sfu.ca/')
OTS_CITATION_STYLE_HASH = os.environ.get('OTS_CITATION_STYLE_HASH', '3f0f7fede090f24cc71b7281073996be')
OTS_CONVERSION_STAGE = os.environ.get('OTS_CONVERSION_STAGE', '5')
class OTSError(Exception):
[root@330e938ed841 swftools-2013-04-09-1007]# ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
@fabiobatalha
fabiobatalha / sample.py
Last active November 14, 2017 13:19
Google Analytics Usage Sample
#!/usr/bin/python
from __future__ import print_function
import argparse
import sys
from googleapiclient.errors import HttpError
from googleapiclient import sample_tools
from apiclient.discovery import build
from oauth2client.service_account import ServiceAccountCredentials
import json
from xylose.scielodocument import Article
def load_document_from_file(filename):
with open(filename, 'r') as f:
for line in f:
data = json.loads(line)
article = Article(data)
@fabiobatalha
fabiobatalha / documents_from_search.py
Created May 17, 2017 21:16
Retorna documents SciELO a partir de uma URL de pesquisa da ferramenta search.scielo.org
from io import BytesIO
import argparse
from urllib.parse import urlparse, urlencode, parse_qs, urlunparse
from articlemeta.client import RestfulClient
import requests
from lxml import etree
LIMIT = 100
from articlemeta.client import RestfulClient
"""
pip install articlemetaapi
Allowed formats:
xylose: default
xmlrsps
xmlwos
xmldoaj
We couldn’t find that file to show.
[
{
"Id": "71ce40619139697a48f13f9ec1a5084ddf6603188df1ff4feecf5592e2e05a1e",
"Created": "2017-05-04T16:14:41.188422797Z",
"Path": "/.r/r",
"Args": [
"publicationstats_loaddata",
"-i",
"-d",
"journal",
@fabiobatalha
fabiobatalha / README.rst
Created February 10, 2017 13:38
Parsing Crossref Schema with Python

Parsing Crossref Schema with Python