You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.
Is your feature request related to a problem? Please describe.
To distribute mods with my friends i made a steam collection. However, when i want to add the steam collection to FASTER i need to add each mod seperately. It isn't that much work, but it could be easier.
Describe the solution you'd like
Copy the steam collection url and paste it in the Steam mods > Add Steam Mods. Maybe there is a checkbox to tell FASTER that this url is supposed to be a collection instead of a single mod.
FASTER will scrape the steam collection webpage and gets all mods in the collection, and adds which mods do not already exist.
Describe alternatives you've considered
None
Additional context
I have been working on this myself and have a bit of code that you could use. I'm a hobby programmer so please take into account that my code can be a bit unusual..
To scrape i used HtmlAgilityPack. I downloaded the .html with this method
publicvoidDownloadFile(stringsteamurl){// Download the webpage into a stringWebClientclient=newWebClient();stringhtml=client.DownloadString(steamurl);// From the string create an Html documentsvardoc=newHtmlDocument();doc.LoadHtml(html);ScrapeHtmlFile(doc);}
After that I scrape the contents of the page with the following function
privatevoidScrapeHtmlFile(HtmlDocumentdoc){List<WorkshopItem>items=newList<WorkshopItem>();// Loop through each collectionitem //doc.DocumentNodeforeach(HtmlNodenodeindoc.DocumentNode.SelectNodes("//div[@class='collectionItemDetails']")){// Get linkHtmlNodelink=node.SelectSingleNode("a[@href]");stringhrefValue=link.GetAttributeValue("href",string.Empty);// Get nameHtmlNodewiname=node.SelectSingleNode("a/div[@class='workshopItemTitle']");stringname=winame.InnerText;// Get short description of modHtmlNodeshortdescriptionnode=node.SelectSingleNode("div[@class='workshopItemShortDesc']");HtmlNodebb_h1=shortdescriptionnode.SelectSingleNode("div[@class='bb_h1']");stringdescription="";// If header of short description returns null add empty stringif(null!=bb_h1){description=bb_h1.InnerText;}// Get idintstringlength=hrefValue.Length;intstartposition=hrefValue.IndexOf("?id=");intlastposition=stringlength-startposition;stringid=hrefValue.Substring(startposition+4,lastposition-4);// If the href containts the right string, then go ahead and create a class with the data inside.if(hrefValue.Contains("https://steamcommunity.com/sharedfiles/filedetails/?id=")){// Add all relavent details to the workshopitem classvaritem=newWorkshopItem(name,Convert.ToInt32(id),hrefValue,description);items.Add(item);}}// Add to listview or datagrid, whatever you want.}
In my c# app I use a listview to show the mods, so you see that I loop through each item and put it in a list, to be used later for my listview. Maybe some parts of the code above do not apply as you might have a more sophisticated design pattern than i use.
Thanks,
Whistle
The text was updated successfully, but these errors were encountered:
Ok. This IS impressive. I haven't thought about steam collections.
However, you could create an Arma preset file with all the mods and import them all at once.
I'll check with steamcmd if steam collections can be imported or if I find another alternative.
Also, nice code ! If you have any other idea for FASTER please let me know. and if you want to contribute, feel free to do so. It's open source after all
Is your feature request related to a problem? Please describe.
To distribute mods with my friends i made a steam collection. However, when i want to add the steam collection to FASTER i need to add each mod seperately. It isn't that much work, but it could be easier.
Describe the solution you'd like
Copy the steam collection url and paste it in the Steam mods > Add Steam Mods. Maybe there is a checkbox to tell FASTER that this url is supposed to be a collection instead of a single mod.
FASTER will scrape the steam collection webpage and gets all mods in the collection, and adds which mods do not already exist.
Describe alternatives you've considered
None
Additional context
I have been working on this myself and have a bit of code that you could use. I'm a hobby programmer so please take into account that my code can be a bit unusual..
To scrape i used HtmlAgilityPack. I downloaded the .html with this method
After that I scrape the contents of the page with the following function
In my c# app I use a listview to show the mods, so you see that I loop through each item and put it in a list, to be used later for my listview. Maybe some parts of the code above do not apply as you might have a more sophisticated design pattern than i use.
Thanks,
Whistle
The text was updated successfully, but these errors were encountered: