Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two new methods #16

Open
gstein opened this issue Aug 9, 2017 · 3 comments
Open

Two new methods #16

gstein opened this issue Aug 9, 2017 · 3 comments

Comments

@gstein
Copy link
Contributor

gstein commented Aug 9, 2017

I extended your Api object within my app (not fork), so I don't have a proper Pull Request for these changes. However, I figured it would be helpful to share the extension for your consideration.

There is some code in here that is specific to my application, but you may be able to extract something generally useful.

extended.txt

@Bemmu
Copy link
Owner

Bemmu commented Dec 19, 2017

Thank you.

I see there is a check for Whoisguard. That one I understand.

What is this ProviderType FREE or CUSTOM stuff? How about Premium?

Anything else here I missed?

@gstein
Copy link
Contributor Author

gstein commented Dec 19, 2017

In my application, we have domains that are configured for BasicDNS, or a custom set of nameservers. If a domain ended up with PremiumDNS, then this snippet would return None (interpreted as mis-configuration).

Note that the status never returns "Locked", contrary to the API documentation. I contacted Namecheap support, and they replied that the RegistrarLockStatus is the way to query that (thus, the separate method).

In this snippet, I extracted the domain expiration date as a string. It might be nice to parse that into a datetime object. (right now, my app ignores it; we only have about 50 domains, so this isn't a concern for automation)

@gstein
Copy link
Contributor Author

gstein commented Dec 19, 2017

I forgot to include BASIC_DNS in that snippet:

# a unique object to signal the domain is using "Namecheap BasicDNS"
BASIC_DNS = object()

The caller can then do something like if nameservers is BASIC_DNS:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants