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
{ | |
"url": "nasasearch.nasa.gov", | |
"elements": { | |
"title": { | |
"selector": "//div[@id='search']/div[@id='results']/div[@class='searchresult']/h2/a", | |
"attribute": "text" | |
}, | |
"link": { | |
"selector": "//div[@id='search']/div[@id='results']/div[@class='searchresult']/h2/a", | |
"attribute": "href" |
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
quickscrape --url "http://nasasearch.nasa.gov/search?affiliate=nasa&query=nustar+x-ray&commit=Search" --scraper journal-scrapers/scrapers/nasasearch.json --output nasasearch --loglevel debug |
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
[ | |
{ | |
"title": "NuSTAR | NASA" | |
}, | |
{ | |
"title": "NuSTAR Delivers the X-Ray Goods | NASA" | |
}, | |
{ | |
"title": "NuSTAR Delivers the X-Ray Goods - NASA Jet Propulsion ..." | |
}, |
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
Three examples of RDF-SKOS definitions taken from http://www.sti.nasa.gov/sscg/main.html | |
1.TURTLE LANGUAGE, a keyword, a category and a division taken from NASA-STI: | |
Common prefixes: | |
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | |
@prefix skos: <http://www.w3.org/2004/02/skos/core#> . | |
File 1: | |
<!-- defining a keyword as a Concept, at URI = http://mydomain.com/infrared+astronomy# --> |
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
<?xml version="1.0"?> | |
<!-- Definition of Category Astronomy --> | |
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
xmlns:skos="http://www.w3.org/2004/02/skos/core#"> | |
<skos:Concept rdf:about="http://mydomain.com/astronomy"> |
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
############################################################################################## | |
# Py3.3 script to navigate DBpedia URIs | |
# install latest RDFlib with 'pip install rdflib' | |
# https://github.com/RDFLib/rdflib/ | |
############################################################################################## | |
from rdflib import Graph, term | |
from rdflib.namespace import SKOS | |
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
{ | |
"_id" : ObjectId("542dfd62d61fce6881caed5e"), | |
"http://www_w3_org/2004/02/skos/core#closeMatch" : [ | |
{ | |
"@id" : "http://dbpedia.org/data/Asteroid.jsond", | |
"_id" : ObjectId("542dfd62d61fce6881caed5d"), | |
"@type" : "http://www.w3.org/1999/02/22-rdf-syntax-ns#resource" | |
} | |
], | |
"http://schema_org/provider" : { |
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
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
# GNU General Public License for more details. |
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
""" | |
Experiment for an automated agent playing Liar's Dice. | |
It's a partial implementation, some possible moves are not yet implemented. | |
Work time spent: 9 hours, considering also the time taken to learn basic rules | |
of the game. | |
It won multiple games beating computer opponents with an average score of 27, | |
where the average score for computer winners were 25. | |
Version 0.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
# coding=utf-8 | |
__author__ = 'Lorenzo' | |
from secret import _KEY | |
def post_curling(url, params, file=None, display=False): | |
""" | |
POST to a remote url and print the response in a file or on screen or return the body of the response | |
:param url: target url | |
:param params: parameters in the request |
OlderNewer