Phase 5 part 5: check the live site after a merge
Merged Sites pages are checked on the live site until they answer with their own words and title; removed ones until they're gone. The SEO loop, the page, the signal's page and Sites → Publishing check (or Check now); two hours without the page points at the deploy hook. Pages going live or away go to IndexNow. Sites → Publishing lists what's waiting, open pull requests and recent merges. Schema 24. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -163,6 +163,29 @@ func (f *Fetcher) get(ctx context.Context, u string, method string, limit int64)
|
||||
return nil, errors.New("too many redirects")
|
||||
}
|
||||
|
||||
// LivePage is a page as the live site serves it.
|
||||
type LivePage struct {
|
||||
Status int
|
||||
Final string // the address after redirects
|
||||
Title string
|
||||
Text string // its visible text
|
||||
}
|
||||
|
||||
// Page reads one page of a live site.
|
||||
func (f *Fetcher) Page(ctx context.Context, u string) (*LivePage, error) {
|
||||
r, err := f.get(ctx, u, http.MethodGet, 4<<20)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
lp := &LivePage{Status: r.status, Final: r.final}
|
||||
if r.status == http.StatusOK {
|
||||
p := PageReport{URL: u}
|
||||
lp.Text = readPageText(&p, r.final, r.body)
|
||||
lp.Title = p.Title
|
||||
}
|
||||
return lp, nil
|
||||
}
|
||||
|
||||
// RunAudit reads a site and checks every page it can find: the sitemap's,
|
||||
// Search Console's, and those linked from them. Issues are ranked by the
|
||||
// page's clicks and impressions over the last 90 days.
|
||||
|
||||
@@ -131,7 +131,9 @@ func SubmitIndexNow(ctx context.Context, d *db.DB, site, key string, pages []str
|
||||
func NewlyLive(d *db.DB, site string, now time.Time) ([]string, error) {
|
||||
since := now.AddDate(0, 0, -14).UTC().Format(time.RFC3339)
|
||||
rows, err := d.Query(`SELECT page FROM seo_changes WHERE site = ? AND status = 'live' AND live_at >= ?
|
||||
UNION SELECT page FROM seo_briefs WHERE site = ? AND status = 'live' AND live_at >= ? AND page != ''`, site, since, site, since)
|
||||
UNION SELECT page FROM seo_briefs WHERE site = ? AND status = 'live' AND live_at >= ? AND page != ''
|
||||
UNION SELECT rtrim(site, '/') || path FROM site_pages WHERE site = ? AND (live_at >= ? OR gone_at >= ?)`,
|
||||
site, since, site, since, site, since, since)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user