Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature for adding extra templated output to the diff #38

Closed
simonw opened this issue Sep 6, 2024 · 1 comment
Closed

Feature for adding extra templated output to the diff #38

simonw opened this issue Sep 6, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Sep 6, 2024

For this project: https://github.com/simonw/scrape-hacker-news-by-domain

I want to include latest links in the human readable output that link to https://news.ycombinator.com/latest?id=41459472 for each item.

I'm going to try using Python format strings like this:

csv-diff --format json simon-previous.json simon.json --key id --extra latest 'https://news.ycombinator.com/latest?id={id}'
@simonw simonw added the enhancement New feature or request label Sep 6, 2024
@simonw
Copy link
Owner Author

simonw commented Sep 6, 2024

Got that working:

3 rows changed

  id: 41459472
    points: "24" => "25"
    numComments: "5" => "6"
  extras:
    latest: https://news.ycombinator.com/latest?id=41459472

  id: 41434857
    points: "1" => "2"
  extras:
    latest: https://news.ycombinator.com/latest?id=41434857

  id: 41427834
    points: "2" => "3"
  extras:
    latest: https://news.ycombinator.com/latest?id=41427834

@simonw simonw closed this as completed in 8f90956 Sep 6, 2024
simonw added a commit that referenced this issue Sep 6, 2024
simonw added a commit to simonw/scrape-hacker-news-by-domain that referenced this issue Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant