Follow the server's reading of pages with no standard: the shared corpus, the title split, and remembered fields in the popup #3
Labels
No labels
bug
documentation
enhancement
performance
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo-chromium#3
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Postulo now reads pages with no structured data further, and remembers where a person's corrections showed a field to be on a site (postulo/postulo#267, landed as
f39f14d0e). Three things follow for the extension.1. The shared posting corpus changed
tests/fixtures/postings/plain-board.jsonnow expects the company "Aperture Science", read from a title line "Job Application for … at Aperture Science". The extension's mirror of that corpus must follow, or the two disagree about the same page.2. Port the title and salary reading to
parse.js, so the preview agreesThe server's page-metadata source now:
og:title,twitter:titleand<title>, and splits a title line on hyphen, en dash, em dash and middle dot (with spaces around), pipe, and "at". A part is named only when something vouches for it: the page's one<h1>names the job; the part after " at" names the employer; a part is a place only when the offline city table knows it and the line names just one; the site's own name (fromog:site_nameor its address) is taken out. Anything else stays empty.$on a page that names no country, and disagreeing salaries give nothing.The server's code is
src/postulo/plugins/builtin/titles.pyandpatterns.py.3. Show remembered fields in the popup
POST /api/v1/captures/previewnow answershinted: the fields ofdatathat came from a place the person's own corrections showed on this site before, rather than from what the page states. Mark them in the popup in words (not colour alone), as the review screen does: "Read where your own corrections showed it on this site before." Corrections the popup sends with a capture already teach the server; nothing new is needed for that.Optional, later: for a page where a corrected value appears twice, the popup could send the DOM place of each corrected field in the shapes the server uses (id, itemprop,
data-*, a label beside the value, a unique class, a heading's position). The server would check it against the HTML it received before remembering it. Not needed for learning to work.Landed in part (
3c7d787): the title split and the salary and closing-date reading are ported (src/lib/titles.js,patterns.js) and the corpus mirror follows the server's. Left, and it is a decision: part 3, marking remembered fields in the popup. The popup never callsPOST /captures/preview, and calling it would send the page to the server before the person presses Send, which PRIVACY.md says never happens. Either accept that (and say so in PRIVACY.md and ask first), or leave the marking to the review screen on the server. The optional DOM-place hints sent with corrections are not done either.