Posted: . At: 9:22 AM. This was 11 months ago. Post ID: 18171
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.



Sponsored



How to get a listing of all news items from ABC News easily.


Getting a listing of all news items from the ABC news website is easy, this example shows how I can get a list of all news item titles and the URL on each line.

╭──(john㉿DESKTOP-PF01IEE)-[~]
╰───────────────────────────╾┋ curl -s https://www.abc.net.au/news/feed/8055316/rss.xml | xmlstarlet sel -T -t -m '/rss/channel/item' -v 'concat(title, " ", link)' -n
'Serial killer': Sydney underworld hit man sentenced after pleading guilty to fourth murder https://www.abc.net.au/news/2023-06-16/abuzar-sultani-sentenced-murder-nikola-srbin-redfern/101585740
Hillsong founder's 'only focus' was to protect church after father's sexual abuse, court hears https://www.abc.net.au/news/2023-06-15/nsw-brian-houston-court-reputation-hillsong/102482718
'The truth will come out': Wallabies star Kurtley Beale pleads not guilty to sexual assault https://www.abc.net.au/news/2023-06-15/kurtley-beale-pleads-not-guilty-nsw/102482438
Swim coach and former MasterChef finalist guilty of 43 child sexual abuse charges https://www.abc.net.au/news/2023-06-14/swim-coach-guilty-on-all-counts-after-child-abuse-trial/102481084
NDIS care provider fined $400k after woman drowns in bath tub https://www.abc.net.au/news/2023-06-14/ndis-provider-fined-after-resident-bath-death/102478372
Sydney congestion tax ruled out as NSW government reveals plan for city's toll roads https://www.abc.net.au/news/2023-06-14/road-toll-plan-sydney-revealed-nsw-government/102477864
'We will not stop': Further arrests expected after second man charged with murder of Sydney bikie figure https://www.abc.net.au/news/2023-06-14/second-man-charged-murder-yusuf-nazlioglu/102477442
NSW government slammed by councils for 'secret' housing rezoning process https://www.abc.net.au/news/2023-06-13/councils-condemn-housing-development-rezoning-nsw/102469134
Joseph has stayed in six hotels since the Sydney fire, he still doesn't know when he can return home https://www.abc.net.au/news/2023-06-12/some-residents-displaced-by-sydney-fire-still-cant-return-home/102467126
Man fatally shot in Sydney's west, prompting NSW Police investigation https://www.abc.net.au/news/2023-06-11/man-fatally-hot-in-granville-nsw-police-investigate/102467498
Wests Tigers stalwart set to leave NRL club after rejecting new contract offer https://www.abc.net.au/news/2023-06-11/nrl-wests-tigers-luke-brooks-rejects-new-deal/102467370
Three teenagers charged after man found dead in Sydney home https://www.abc.net.au/news/2023-06-11/three-teenagers-charged-over-mans-death-in-sydneys-west/102467180
Sydney man charged after stabbing stranger on a bus in broad daylight https://www.abc.net.au/news/2023-06-11/nsw-darlinghurst-bus-stabbing-man-charged/102466860
Police say no bodies found in debris of Sydney fire, some residents will have to wait weeks to return https://www.abc.net.au/news/2023-06-10/no-bodies-found-in-debris-surry-hills-fire-nsw-police-say/102465936
Australian authorities on alert as Sikh-Hindu tensions over Khalistan separatist movement boil over in Sydney https://www.abc.net.au/news/2023-06-10/tensions-over-khalistan-separatist-movement-boil-over-in-sydney/102463024
'That's not cheating. That's just learning': How uni students in Sydney and Hong Kong are embracing AI https://www.abc.net.au/news/2023-06-10/university-students-in-sydney-and-hong-kong-using-gen-ai/102455732
'Taken out of context': Detective responds to claims she was hostile towards Scott Johnson family  https://www.abc.net.au/news/2023-06-09/detective-accused-hostility-johnson-family-speaks/102460342
Police don't know where Sydney developer is after arrest warrant issued over alleged fraud https://www.abc.net.au/news/2023-06-09/arrest-warrant-for-sydney-developer-jean-nassif/102460232
Sydney council spends millions blocking developments, as mayor at risk of losing her view https://www.abc.net.au/news/2023-06-09/north-sydney-council-spends-millions-developers-court/102454792
'Our family has got some peace': Sydney cliff killer jailed decades after death of US mathematician https://www.abc.net.au/news/2023-06-08/scott-white-sentenced-manslaughter-scott-johnson/102454438
Qantas and Jetstar first airlines to fly domestically from Sydney's new $5.3b airport https://www.abc.net.au/news/2023-06-08/qantas-jetstar-first-airlines-fly-western-sydney-airport/102456072
Calls to force landlords to install solar panels on tenants' roofs https://www.abc.net.au/news/2023-06-08/australian-landlords-face-mandatory-solar-installation-calls/102449862
Sydney needs more homes — but for some in this part of town, development is a dirty word https://www.abc.net.au/news/2023-06-08/nsw-government-tested-by-proposed-meriton-development-zetland/102405572
'Staggering' fall in plastic bags polluting Sydney Harbour — but there's still much to do https://www.abc.net.au/news/2023-06-07/most-plastic-bags-gone-from-sydney-harbour-since-ban-seabin-says/102446138
NRL stands down Parramatta Eels star Dylan Brown after groping allegations  https://www.abc.net.au/news/2023-06-07/dylan-brown-faces-court-charged-with-sexual-touching-sydney/102449388

In this useful one-liner:

  • -m ‘/rss/channel/item’: matches every item element under /rss/channel
  • -v ‘concat(title, ” “, link)’: concatenates the values of title and link, separated by a space.
  • -n: adds a newline after each pair (title and URL) for better readability.

This will output the title followed by its corresponding URL on separate lines for each item in the RSS feed.

This is how to extract items from an RSS feed very easily. I can not get a newline inserted in the output to work on the Linux shell for some reason.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.