You are not logged in.

#1 2019-09-30 16:43:23

IrvineHimself
Member
From: Scotland
Registered: 2016-08-21
Posts: 275

[Solved] Querying Aur with curl or wget?

Is it possible to query the Aur with either curl or wget without all the HTML elements?

For example, either of the following urls can be used to query the Aur, but unfortunately they return full html pages.

curl https://aur.archlinux.org/packages/?K=<PACKAGE SEARCH>
curl https://aur.archlinux.org/packages/<PACKAGE NAME>

Irvine

Last edited by IrvineHimself (2019-09-30 17:43:19)


Et voilà, elle arrive. La pièce, le sous, peut-être qu'il arrive avec vous!

Offline

#2 2019-09-30 16:55:58

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,846
Website

Re: [Solved] Querying Aur with curl or wget?


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2019-09-30 17:42:48

IrvineHimself
Member
From: Scotland
Registered: 2016-08-21
Posts: 275

Re: [Solved] Querying Aur with curl or wget?

Thanks

Irvine


Et voilà, elle arrive. La pièce, le sous, peut-être qu'il arrive avec vous!

Offline

#4 2019-10-01 12:26:18

IrvineHimself
Member
From: Scotland
Registered: 2016-08-21
Posts: 275

Re: [Solved] Querying Aur with curl or wget?

Just a quick supplement for people  who arrive here from a google search.

Depending on what you want to achieve, (or if you are looking for a something that works with other websites,) an alternative solution is to use the above urls with lynx -dump:

eg

lynx -dump "https://aur.archlinux.org/packages/<PackageName> "  >  "$TmpFile"
grep  "<Thing of interest>" "$TmpFile"

Essentially, lynx -dump gives a plain text file which can be easily manipulated with your choice of grep, sed , awk ... etc

Irvine


Et voilà, elle arrive. La pièce, le sous, peut-être qu'il arrive avec vous!

Offline

Board footer

Powered by FluxBB