Tvijo wiki
Каталог

Теми

Reproducible reads from the public Tvijo Wiki API

Read a public article, check its body revision, and preserve the information needed to cite and revisit it.

🎯 Для Readers and developers building source-linked research or read-only workflows.

📚 Ви дізнаєтеся
  • Retrieve a public article and record its source, language, body hash, observation time and license.
  • Distinguish a stale body revision from HTTP cache validation.
  • Check a UTF-8 body hash and handle a stale-revision response.

Цю сторінку ще не перекладено. Ви читаєте англійський оригінал.

The public Tvijo Wiki API lets you read published articles without a login or API key. To make a reading reproducible, keep the article URL, language, body hash, observation time and license together. A title alone is not enough: the text behind it can change.

Find and read a page

The API documentation describes the read-only interface. Fetch an English article at /api/wiki/pages/<slug> or its Russian edition at /api/wiki/pages/ru/<slug>. For discovery, use /api/wiki/pages?lang=en&limit=20&offset=0 and /api/wiki/sections. Search with /api/wiki/search?q=<urlencoded>&lang=ru; URL-encode the query. A search result or snippet is a starting point, so read the full article before relying on a passage. There is no public /context endpoint in this contract.

The response includes content_md, url, lang, sha256 and a license block. The hash is calculated from the UTF-8 bytes of the returned Markdown body. It identifies that body, not its truth, rights or the entire response. The updated field is a publication timestamp; it is not guaranteed to be the time of the latest body modification.

Check a held revision

Request the same page with ?sha256=<held> to ask whether its current body matches your held hash. A match returns 200. A different body returns 409 with error set to stale_revision and current_sha256; fetch the new body and review any answer based on the old one. Retain the old revision label rather than silently replacing it.

HTTP caching is a separate mechanism. ETag identifies an HTTP representation, and sending it in If-None-Match can return 304 when that representation is unchanged. Do not substitute the body sha256 for an ETag or assume the two values are interchangeable.

Exercise: check one public source

Run this small Python example with the standard library. It reads the existing source-linked answers exercise, checks the returned body hash, then asks for a deliberately stale revision:

import datetime, hashlib, json, urllib.error, urllib.request
url = 'https://tvijo.com/api/wiki/pages/source-linked-answers-practice'
headers = {'User-Agent': 'TvijoWikiExample/1.0'}
request = urllib.request.Request(url, headers=headers)
with urllib.request.urlopen(request, timeout=20) as response:
    page = json.load(response)
assert hashlib.sha256(page['content_md'].encode('utf-8')).hexdigest() == page['sha256']
receipt = {key: page[key] for key in ('url', 'lang', 'sha256', 'license')}
receipt['observed_utc'] = datetime.datetime.now(datetime.timezone.utc).isoformat()
probe = urllib.request.Request(url + '?sha256=' + '0' * 64, headers=headers)
try:
    with urllib.request.urlopen(probe, timeout=20):
        raise AssertionError('Expected a stale-revision response')
except urllib.error.HTTPError as error:
    result = json.load(error)
    assert error.code == 409 and result['error'] == 'stale_revision'
    receipt['stale_revision_status'] = error.code
print(json.dumps(receipt, ensure_ascii=False, indent=2))

The expected stale probe is 409 stale_revision. Keep the printed observation time and license with the other receipt fields. If the request fails or the response differs, preserve that result and investigate rather than marking the exercise successful.

The Wiki license permits reuse subject to citing and linking the source page. Keep that permission with the body you use; metadata about a third-party source does not itself grant rights to copy that source's body. For evaluating an answer, use the human-review practice and the knowledge-to-practice guide. A matching hash makes the input identifiable; a person still needs to check whether the answer represents it faithfully.

Search currently matches substrings; a paraphrase can miss an existing article. English and Russian are supported, and missing translated fields may fall back to English. Check the returned text as well as the requested language.

Джерела

Нижче наведено джерела та дати спостережень. Статус перевірки зазначено для кожного матеріалу.

  1. Tvijo Wiki API documentation
  2. Answers with sources: practice on one small wiki entry
  3. Connections, backlinks and the knowledge graph

Зв’язки опублікованих статей. Виберіть вузол, щоб відкрити статтю біля заголовка.

100%
→ Пов'язані статті← Посилаються сюди⋯ Та сама тема
Зв’язки статей · клавіатура / текст

💬 Коментарі

Коментарі публічні та модеруються. Не публікуйте персональні дані.
  • Коментарів ще немає. Будьте першим!

Наступні кроки