You are not logged in.
Pages: 1
How do I download _comments_ for X package in AUR? Maybe what I need to know is how do I translate 'packagename' to http://aur.archlinux.org/packages.php?d … =1&ID=2243 << correct number
I mean i want the ID for a given pkgname if that was no very clear.
This so I can add it to yaourt, and don't have to check the comments section in aur with a browser since many times, fixes are posted there...
KISS = "It can scarcely be denied that the supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of experience." - Albert Einstein
Offline
The ID are assigned in the order that the packages are first submitted to AUR. In your example, x-develop was the 2243rd package submitted to AUR. I can't think of any way to translate the pkgname to ID except by keeping a list of all the packages in AUR with their corresponding ID.
Offline
ID except by keeping a list of all the packages in AUR with their corresponding ID.
I believe when I built the original version of aurbuild, I used the search function and scraped the ID from an URL in the link.
Yeah, see here:
http://wiki.archlinux.org/index.php?tit … 2#aurbuild
page="http://aur.archlinux.org/packages.php?K=" + name
reg="'/packages.php><span>" + name
ID=getsubstring(page, reg, "ID=", "&")
However, Penguin has probably come up with a much better way to do it, so I'd check the sources of his version of aurbuild. The primary issue is that span class='black' -- I don't think that works for safe or flagged packages (green, red).
Dusty
Offline
after you do the basic keyword search, parse the results page in data1 and data2 groups. For each of those groups you can get the full id url (direct link to the package main page) by matching >pkgnames[0-9].*
Offline
thanks guys, got it working. I didn't look at what is data1 and data2 but this worked:
data1=`lynx -nolist -source "http://aur.archlinux.org/packages.php?K=${PKG}"|grep data1`
aurID=`echo "$data1"|egrep -o "ID.*${PKG}"|cut -c 4-|cut -c -4`
lynx -dump -nolist "http://aur.archlinux.org/packages.php?do_Details=1&ID=${aurID}"|sed -n '/Comments$/,/Add Comment$/p'|sed 's/pad.gif//'
i suppose it would be even neater with color coding etc, but that will have to be looked at another time
edit: changed it to be a bit neater
lynx -dump -nolist "http://aur.archlinux.org/packages.php?do_Details=1&ID=${aurID}"|sed -n '/Comments$/,/Add Comment$/p'|sed 's/pad.gif//'|sed 's/Comment by:/^[[1;37mComment by:^[[1;39m/g'|sed 's/[]//g'|sed 's/ Comments//'|sed 's/Add Comment//'
Although i'd rather the whole 'Comment by: username' line was in another color, but i'm not so good with sed/regexp. Suggestions welcome
KISS = "It can scarcely be denied that the supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of experience." - Albert Einstein
Offline
Pages: 1