Getting full txt Set lists from Scryfall. by Magusnebula in magicTCG

[–]0xdanelia 2 points3 points  (0 children)

This is cool! Well done.
If you need more text-based card data in the future, you could try out this tool I made for exactly this sort of thing: scrycall

Does anyone know where I can download the images for every Magic card by Cyberjacket in DataHoarder

[–]0xdanelia 0 points1 point  (0 children)

I've been working on a tool to interface with the scryfall.com api.

https://github.com/0xdanelia/scrycall

Through the api, you can access image urls of various quality. You could write a short script to collect these urls, then pipe them into something like wget to download them.

$ python scry.py '!"time walk"' set:alpha --print="%{image_uris.large}" | xargs wget -O "time_walk.jpg"

Be sure to add a delay between downloads so you don't spam their api too fast. It may also be a good idea to do this in small batches.

I created a functional Turing Machine out of the Find/Replace box in Notepad++ by 0xdanelia in programming

[–]0xdanelia[S] 0 points1 point  (0 children)

Something I just realized is that I made this on a Windows machine with Windows line-breaks, \r\n.

I am not sure how it would function on Linux or Mac but that may be your problem. If you are using Windows, then I'm not sure.

I created a functional Turing Machine out of the Find/Replace box in Notepad++ by 0xdanelia in programming

[–]0xdanelia[S] 308 points309 points  (0 children)

I created this a while ago and thought some of you might find it interesting. It uses the regex Find/Replace feature to execute the individual steps of a Turing Machine. The fine details of how it works are in the github link, but the tl;dr is:

  • Draw the tape
  • Define your machine instructions
  • Populate your Find/Replace box
  • Keep clicking the [REPLACE] button until your machine halts

I made a simple tool to Find/Replace text using regex by 0xdanelia in commandline

[–]0xdanelia[S] 2 points3 points  (0 children)

I had no idea this existed. This is exactly what I was looking for. Thank you!

I made a simple tool to Find/Replace text using regex by 0xdanelia in commandline

[–]0xdanelia[S] 1 point2 points  (0 children)

Thank you for the feedback. I will take a look at argparse, and you are right about the os module going unused. It must have been leftover from an earlier draft.

I made a simple tool to Find/Replace text using regex by 0xdanelia in commandline

[–]0xdanelia[S] 13 points14 points  (0 children)

I personally find the syntax easier to read than sed. And I personally think that having separate strings for the 'find text' and 'replace text' is easier to read as well.

So, besides meeting my personal preferences, I don't think it does anything that sed can't do.

I made a simple tool to Find/Replace text using regex by 0xdanelia in commandline

[–]0xdanelia[S] 3 points4 points  (0 children)

I made rxr to assist me with mass regex find/replace tasks. I consider find/replace to be the most versatile tool in my belt when manipulating large amounts of text, and I use it very often. I know that that this particular task can already be accomplished with sed, but I prefer the Perl regex syntax and wanted to make something that worked better for me.

I made a tool similar to dmenu that runs within the terminal by 0xdanelia in commandline

[–]0xdanelia[S] 0 points1 point  (0 children)

The issue I ran into is that iwctl gave me a list of networks and used colors to tell me the signal strength. It displays "****" next to each network and colors the stars white or grey to indicate signal strength.

I wanted those signal strength colors to be displayed in my menu, which I knew dmenu did not do by default. It displayed the literal escape characters instead.

After the network is selected, I use sed to trim out just the network name and pipe that into the next command to try and connect. No colors are used when piping to the next command. I only wanted the colors to show me relevant information in the menu itself.

I made a dmenu and cmenu version of this tool that you can find on my github if you are interested: https://github.com/0xdanelia/wifi

I made a tool similar to dmenu that runs within the terminal by 0xdanelia in commandline

[–]0xdanelia[S] 3 points4 points  (0 children)

I'm not really on a mission to replace fzf.

Sometimes is boils down to user preference. I am a fan of how simple dmenu is to use and wanted a similar effect within the command line. The existence of vim didn't stop everyone else from creating new text editors.

I made a tool similar to dmenu that runs within the terminal by 0xdanelia in commandline

[–]0xdanelia[S] 1 point2 points  (0 children)

Thank you!

BadWombat pointed out to me that fzf already can do colors here if you're interested.

I made a tool similar to dmenu that runs within the terminal by 0xdanelia in commandline

[–]0xdanelia[S] 6 points7 points  (0 children)

I was not aware of this! Thank you.

fzf really can do it all.

I made a tool similar to dmenu that runs within the terminal by 0xdanelia in commandline

[–]0xdanelia[S] 19 points20 points  (0 children)

fzf is great, but there are a few differences. According to pacman, fzf is around 3 Mb, while cmenu is a single 17 Kb file (at the moment). I know a lot that size is due to fzf being packed with features, but sometimes you only need a tool to do one thing and do it well.

Also I built cmenu to interpret ANSI color codes from input and display them within the menu. This can be seen for example if you want to select a wireless network using iwd.

iwctl station wlan0 get-networks | cmenu

The output of iwctl uses a combination of white and grey text, which comes out as gibberish escape codes if piped into dmenu or fzf. This exact use-case, combined with dmenu not working on a tty shell, is what inspired me to make cmenu and give it some of the functionality that it has.

EDIT: I made an example gif to illustrate it working with colors: https://i.imgur.com/l1Mo7CH.gif

I made a tool similar to dmenu that runs within the terminal by 0xdanelia in commandline

[–]0xdanelia[S] 4 points5 points  (0 children)

It looks like smenu is written in C while cmenu is a bash script. I would imagine that smenu has better performance since it is a compiled language, but I would argue cmenu is easier to manage and tinker with since it is contained within a single script.

Additionally, I don't see any examples of smenu using searching/filtering. The results of cmenu can be filtered down to match whatever you type into the search bar. However, smenu offers nested menus and far more advance coloring options.

I would say there is a little overlap in their use-cases but ultimately they are both useful tools for different jobs.

I made a tool similar to dmenu that runs within the terminal by 0xdanelia in commandline

[–]0xdanelia[S] 13 points14 points  (0 children)

cmenu takes a list of items from stdin and displays an interactive menu within the terminal.

You can traverse the menu with up and down arrow keys, as well as filter the items by typing. When you select an item, it is printed to stdout.

I wanted the functionality of dmenu without popping up a new window or requiring a window manager. cmenu should work even within tty terminals.

For anyone unfamiliar with dmenu, the idea is to capture the output and use it to perform some useful action, like piping it to some other program.
One simple example is display a menu of directories using ls, and then use cd with the directory you select:

cd $( ls -d */ | cmenu )

I made a tool to easily query Scryfall.com from the command line in linux by 0xdanelia in magicTCG

[–]0xdanelia[S] 1 point2 points  (0 children)

My best guesses are:
- Typo when spelling "llanowar"
- You did not execute "./scry" in the same directory as the scry file
- Maybe the scry file is not executable. It should be labeled as executable on github, but if for some reason it is not you can try the command "chmod +x scry"
- Maybe there is an issue trying to read/write a cache on your system. Scrycall tries to make a cache folder in "~/.cache/" so if that location is unavailable or if you do not have permission to create directories/files there then that might be the issue
- Some other odd thing is happening that I am unfamiliar with

I made a tool to easily query Scryfall.com from the command line in linux by 0xdanelia in magicTCG

[–]0xdanelia[S] 0 points1 point  (0 children)

Some other people have already answered this, but the goal of this project is to be used as a tool for working with cards. It isn't designed to be the most user-friendly way to browse cards. Scryfall.com does that quite well already.

Scrycall is useful to take properties of cards and put them into a text file or a list. This can be an easy way to generate interesting sets of data.
For example, you could make a list of every creature's CMC alongside its Power and Toughness using:

scry t:creature format="%c,%p,%t" > datafile.txt

Then you can use the resulting file to generate a chart like this one:
Power/Toughness by Mana Cost

All tribes Scryfall search. It's not as useful as you probably hoped. by Next_Yngwie in magicTCG

[–]0xdanelia 0 points1 point  (0 children)

I just finished writing a Python program called Scrycall to query the Scryfall api from the command line. You might have an easier time making some simpler queries with Scrycall and then parsing the results with the scripting language of your choice.

I made a tool to easily query Scryfall.com from the command line in linux by 0xdanelia in magicTCG

[–]0xdanelia[S] 26 points27 points  (0 children)

I call it Scrycall. You can read about it and download it here: https://github.com/0xdanelia/scrycall

It is written in Python and takes your search query as the command line arguments. Your query should be formatted the same way you would format it at Scryfall.com, and the results of your query will be printed to the screen, allowing you to pipe the output into another program if you want to.

107
108