Tool to check if name is taken

Who does not know the situation when you want to name a new guest, but you are not sure if the name is already taken?
Now I have a solution. It is very simple and tells you immediately if the name is taken or not.

A new version of the script which works with the new archives can be found here:
Tool to check if name is taken - #31 by jabbath1987

Deprecated

Unfortunately I can’t upload any scripts here, so the best thing is to copy my little code snippet and you’re all set:

  1. Create a new file and name it CheckNames.ps1. It is important to use the extension .ps1.
  2. Open the file with a text editor, copy and paste my code below and save it.
  3. Right click and choose Run with PowerShell.
  4. Currently only works on Windows. I also have a Python version of this that is OS agnostic. If you prefer that, just PM me.
$webClient = New-Object System.Net.WebClient

do
{
    Write-Host "Enter a name to check:"
    $name = Read-Host

    $html = $webClient.DownloadString("https://voyeur-house.tv/moments")

    if ($html -match $name)
    {
        Write-Host "Name taken"
    }
    else
    {
        Write-Host "Name available"
    }

    Write-Host "Do you want to search for another name? (y/n)"
    $continue = Read-Host
} while ($continue -eq "y")


4 Likes

That’s seems too nerdie! :grin:

I use this (and it’s also helpful to see possible name derivations)

1 Like

I used that before. But my tool is the faster one :joy: :innocent:

2 Likes

Try to run it from a powershell window and tell the error you get.

1 Like

This is strange. Maybe your path variables are not properly set up?
A new version of the script which works with the new archives can be found here:
Tool to check if name is taken - #31 by jabbath1987

Deprecated

I can give you the script as Python when you want? You need to have Python installed to use it of course… Do everything like above. Just save it as CheckNames.py

while True:
    name = input("Enter a name to check:")

    try:
        import urllib.request
        with urllib.request.urlopen("https://voyeur-house.tv/moments") as response:
            html = response.read().decode('utf-8')

        if name in html:
            print("Name taken")
        else:
            print("Name available")

    except Exception as e:
        print("An error occurred:", str(e))

    choice = input("Do you want to search for another name? (y/n)")
    if choice.lower() != 'y':
        break

1 Like

I noticed you used the cmd shell to try and run it. Please try to open Powershell as Admin and navigate where you have the script and then try to open it. You should at least get an error

1 Like

Ah we can fix that easily :wink:

Open power Shell as Admin and enter the following and press J

Set-ExecutionPolicy RemoteSigned

1 Like

Indeed it can… Just check post nº2 :rofl: :rofl:

1 Like

:joy:
Tom And Jerry Reaction GIF

1 Like

Should now work with double click on it too when you associated the .ps1 extension with Windows PowerShell :wink:

1 Like

Thanks for the code add. Do you happen to work and IT too?

1 Like

Yes I do. :wink:

1 Like

Does this mean it works in Android?

Yes. You just need to install a Python environment
I use QPython3

1 Like

Gotcha. But as I understand it, neither of your scripts work at the moment. Is that right?

It still works. As long as VHTV does not take down the old archives. I am already working on a new one. But for now it works.

Good. Can you post the one for Android. Thanks.

1 Like

I don’t know the first thing about scripts, or Python, etc. This is how I see the script you posted when it’s on my screen.

So, I just highlighted everything from while true down to break and copied and pasted it into a file called namecheck.py. This is how it looks in the file.

while True:
name = input(“Enter a name to check:”)

try:
    import urllib.request
    with urllib.request.urlopen("https://voyeur-house.tv/moments") as response:
        html = response.read().decode('utf-8')

    if name in html:
        print("Name taken")
    else:
        print("Name available")

except Exception as e:
    print("An error occurred:", str(e))

choice = input("Do you want to search for another name? (y/n)")
if choice.lower() != 'y':
    break

Did I get everything, is it formatted correctly? There are no colors. Does that make a difference?

I installed QPython3. Do I open that and run the script within that environment, or is there something else I need to do? When I run it can I enter the name after the file name, or do I have to wait for it to ask me for a name? Thanks for your help.

Yes exactly. I will show how it is done. Wait