wi-ry / misc-powershell Goto Github PK
View Code? Open in Web Editor NEWMiscellaneous PowerShell Scripts
License: Apache License 2.0
Miscellaneous PowerShell Scripts
License: Apache License 2.0
Running New-RandomString2 doesn't include numbers in the passwords generated, but it should.
Need to look into why at some point
With some tweaks to the code, I think this script could check multiple subreddits. I feel like that would be smart, especially when combined with making the naming of files be human-readable, at that would catch crossposts and eliminate duplicates.
per my understanding, this script:
What it does not do is, interpret the JSON a PowerShell object, using the ConvertFrom-JSON
cmdlet.
I think refactoring the code to use ConvertFrom-JSON
could improve things. For example, the script could name the files based on the Title of the Reddit thread, rather than the original filename (which is randomized or serial-numbered, not human-readable).
It may also allow filtering on keywords, tags, or resolutions of images based on the properties available within the JSON. As I haven't implemented this myself, I can't say for sure, but I'd wager at least some of this would be easy enough to do.
Alternatively, the script could be reimplemented to use a Hashtable. This would give a similar result.
By design, this script only downloads files with names like *.JPG. Should a file be named *.JPEG it will not be processed. PNG files will also not be processed.
I'm working on a way to fix that.
There's a significant block of code in this script which appears to be present specifically to check that files are no smaller than the specified minimum Height and Width parameters.
The Height and Width values of the images are contained within the JSON:
data.children.data.preview.images.source.height
data.children.data.preview.images.source.width
We can filter out files that are below the minimum specified by the input parameters, just have to rework a bit of the code. I'll see what I can do.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.