-
Notifications
You must be signed in to change notification settings - Fork 344
Download helper functions for common annoying sources #377
Comments
I have to add that while my exemplary gist, linked in the comments about AOMEI Partition Assistant Standard, is working, it was only a kind of quick and dirty how-it-can-be-done thing. It may work as a first approach, but it's wrong in the long term, because regexps shouldn't be used to parse html - html parser is needed for it. Question is whether PowerShell has html parser out-of-the-box and if not, which one of open source ones out there (I think there should be at least one, but haven't googled yet) should be included in chocolatey for convenience of package creators. |
Nothing wrong with it. I use regexes for other packages too. Just didn't think about using a bunch of them in a row. Maybe your regexes are smarter, I just rewrote them because I don't get the |
What is being described here sounds to me like a Chocolatey.Contrib project, which is where the helper module would like. This could then be a standalone package that people can take a dependency on. Thoughts? |
Same problem again. Fixing the broken CNET parser needs all packages fixed. This should be internal, just like SourceForge is handled internally. |
For reference: However, why does this return an array?
|
In line 33, the To fix this, either:
|
Thanks! 👍 |
How about adding
to https://github.com/chocolatey/chocolateytemplates /helpers ? |
I still think helpers should have a certain format, and they should be packages that can be referenced as dependencies. One change means one package to fix, and all packages that depend on it will work again. |
We need download helper functions for sites that are often hosting the software we pacakge.
Because now, every time a site breaks, we have to fix and push and moderate a lot of packages, while fixing the helper would fix all packages at once.
Sourceforge(is a built-in helper)@gep13 said:
@Redsandro said:
@ferventcoder said:
@ferventcoder I didn't mean that in a bad way. It's good that Chocolatey has some quality assurance before being pushed.
Maybe if we're gonna do this we should have the helper functions in a separate module that can be updated instantly, independent of Chocolatey, when someone pushes a fix.
Anyway I just wanted to put this out there. In case anyone wants to play with it.
I've extracted the regex code to a separate module here:
https://github.com/Redsandro/chocolatey/blob/master/partitionassistant/tools/Get-UrlFromCnet.ps1
The example regex (
Get-FilenameFromRegex $url '(?ms).*href="(http://download.cnet.com/.+?)".*'
) works when there is only one CNET link on the page. Otherwise it has to be more detailed (e.g. add anchor text/title).The text was updated successfully, but these errors were encountered: