This file contains hidden or 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 mwclient import Site | |
| from mwtemplates import TemplateEditor | |
| site = Site('sv.wikipedia.org') | |
| site.login('xusername', 'pwd') | |
| # https://sv.wikipedia.org/wiki/Vincent_Lundberg | |
| # https://sv.wikipedia.org/w/api.php?action=query&titles=Vincent_Lundberg&prop=revisions&rvprop=content&format=json | |
| page = site.pages['Vincent Lundberg'] | |
| te = TemplateEditor(page.text()) | |
| for t in te.templates.items(): |
This file contains hidden or 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
| #!/bin/bash | |
| for i in `cat ~/scripts/working/purgescript-test.tsv`; | |
| do | |
| echo "$i to be purged" | |
| python3 ~/pywikibot/pwb.py touch -page:$i -purge | |
| done |
This file contains hidden or 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
| #https://kulturpersoner.uppsalakyrkogardar.se/galleri/ | |
| import requests | |
| import urllib.request | |
| import time | |
| from bs4 import BeautifulSoup | |
| def cleanupstring(s): | |
| out_s = s | |
| while ' ' in out_s: | |
| out_s = out_s.strip().replace(' ', ' ') | |
| return out_s, len(s)-len(out_s) |
This file contains hidden or 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 json | |
| import traceback | |
| import requests | |
| import sys | |
| from SPARQLWrapper import SPARQLWrapper, JSON | |
| endpoint_url = "https://query.wikidata.org/sparql" | |
| # SPARQL finding objects with Property P7704 Europeana https://w.wiki/PrV | |
| query = """SELECT * WHERE { |
This file contains hidden or 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
| #Test extract första "ExtractNumberChar" tecknen Wikipedia artikeln | |
| #fundering https://sv.wikipedia.org/wiki/Wikipedia:Projekt_naturreservat#Enhetlighet_i_beskrivningar_i_Wikidataobjektet | |
| # pip install sparqlwrapper | |
| # https://rdflib.github.io/sparqlwrapper/ | |
| import sys | |
| import urllib | |
| from SPARQLWrapper import SPARQLWrapper, JSON | |
| import requests |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| """ Code that generate for all districts the | |
| BygdebandID | |
| Wikidata Qid | |
| Page id or curid | |
| Name of Wikipedia article | |
| URL Bygdeband | |
| URL Wikidata | |
| See video https://youtu.be/Zno9C5xR2UQ | |
| SPARQL https://w.wiki/QHP |
This file contains hidden or 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" encoding="UTF-8"?> | |
| <metadata xml:lang="sv"> | |
| <Esri> | |
| <CreaDate>20150410</CreaDate> | |
| <CreaTime>08095700</CreaTime> | |
| <ArcGISFormat>1.0</ArcGISFormat> | |
| <SyncOnce>FALSE</SyncOnce> | |
| <DataProperties> | |
| <itemProps> | |
| <itemName Sync="TRUE">Varldsarv</itemName> |
This file contains hidden or 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
| # https://phabricator.wikimedia.org/T236131 | |
| import urllib3 | |
| from bs4 import BeautifulSoup | |
| from dataclasses import dataclass | |
| @dataclass | |
| class glacier: | |
| id: int | |
| name: str | |
| drainagebasin: str |
This file contains hidden or 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
| # Check the quality of the Wikidata Property P3188 | |
| # See discussion if we should delete it or not | |
| # https://www.wikidata.org/wiki/Wikidata:Properties_for_deletion#Nobelpris-ID_(P3188) | |
| # | |
| import sys, urllib3 | |
| from SPARQLWrapper import SPARQLWrapper, JSON | |
| version = "0.0.2" | |
| endpoint_url = "https://query.wikidata.org/sparql" | |
| # SPARQL https://w.wiki/Rbb |