« first day (172 days earlier)      last day (1367 days later) » 

2:27 PM
Hey @Zoe What's been up with Alisha lately? Is she on vacation?
 
Zoe
She's taken down. There's too much that needs fixing and I currently don't have time (or the desire) to fix the bugs and add necessary features for it to be sensible to run her.
 
Oh, pity. I liked her, made the room a bit more goofy. But of course you shouldn't waste time on her if you didn't like to
 
Zoe
It's just for now though. I'll probably do something in a couple of weeks
 
Ah, good :)
 
 
3 hours later…
5:55 PM
@QHarr : I got an error at line 15
for resolve in pdns_results['results']:
TypeError: 'NoneType' object is not subscriptable
 
Just eating. Give me 20-30 mins. Did you use the script exactly as shown but inserting your own credentials and have you stayed at/under the 15 API calls per day?
 
Yes I have inserted the credentials .. Have a nice meal
 
And are you below the API limit of 15 p/d and using code as shown?
 
I don't know how to know the limit
But sure I am limited as I have registered for free
 
6:10 PM
It will be in your dashboard.
 
If I registed another account .. will I be able to have new fresh tries?
I found that in account settings : API Searches
4 of 15
so I have more chances :)
 
Possibly. Ok.. so you still have more goes.
And your script is otherwise the same as mine?
Just you are running from pycharm.
 
Yes exactly
except for the two lines of credentials
and the user name where I would download the json file
Yes
I am running it from pycharm
 
Might be tough for me to debug as runs perfectly for me. Let me hit the API one more time this evening and see if still runs. The json part isn't a problem as the python script is only dumping json out there.
Don't really want to download pycharm on this machine.
I have a ton of stuff on this already.
 
Is that may make any difference?
 
6:15 PM
I don't think so tbh.
 
what tbh ..?
 
To Be Honest
 
sorry as English is not my native language
Thanks :)
 
:-)
 
Can I post you my code with the credentials so as to try it
May be something wrong with my code
 
6:17 PM
Just ran it fine. Post the code here without your credentials showing. 1) It is bad practice to share credentials 2) It is against the terms of service of the API
 
Zoe
@YasserKhalil the array is null
 
import requests
import json

username = 'yyy'
key = 'ccc'
auth = (username, key)
base_url = 'https://api.passivetotal.org'

def passivetotal_get(path, query):
url = base_url + path
data = {'query': query}

pdns_results = passivetotal_get('/v2/dns/passive', 'passivetotal.org')

for resolve in pdns_results['results']:
print('Found resolution: {}'.format(resolve['resolve']))

with open(r"C:\Users\Future\Desktop\Sample.json", "w") as text_file:
text_file.write(json.dumps(pdns_results['results']))
 
looks fine
 
Zoe
Does it require an API key?
 
But for some reason your list pdns_results isn't populated
 
Zoe
6:20 PM
It's not just that; an empty array would still pass the for loop. It's null, so likely you don't get a response from the API
 
How can I know array is null or not ../ I have no idea about debugging in python
 
Zoe
if pdns_results is None:
    handle
 
Yah
 
but when using CURL I got response
 
Zoe
oh
Did you post the entire method? (passivetotal_get)
because if that's the entire one, you actually don't return anything, which (IIRC) means it ends up as null
unless it translates it to a method reference, I don't remember
 
6:22 PM
@Zoe The print statement is simply writing out the dictionaries within the collection
 
I used this line in CURL
curl -u user:password -o Sample.json 'https://api.passivetotal.org/v2/dns/passive?query=passivetotal.org'
 
Zoe
I'm not asking about the print statement @QHarr
def passivetotal_get(path, query):
    url = base_url + path
    data = {'query': query}

pdns_results = passivetotal_get('/v2/dns/passive', 'passivetotal.org')
 
this is link
https://api.passivetotal.org/v2/dns/passive?query=passivetotal.org
 
Zoe
If that is the entire method, notice how it doesn't return anything
or call the API
 
where is the requests.get line?
Good spot @Zoe
 
Zoe
6:24 PM
That assumes there's not more to the method though. But yeah, that would explain it.
 
import requests
import json

username = 'xxx'
key = 'yyy'
auth = (username, key)
base_url = 'https://api.passivetotal.org'

def passivetotal_get(path, query):
    url = base_url + path
    data = {'query': query}
    # Important: Specifying json= here instead of data= ensures that the
    # Content-Type header is application/json, which is necessary.
    response = requests.get(url, auth=auth, json=data)
    # This parses the response text as JSON and returns the data representation.
    return response.json()
 
I am sorry I can't get most of what you said :) .. sorry for that as English is not my native
 
This:
for resolve in pdns_results['results']:
   print('Found resolution: {}'.format(resolve['resolve']))
was simply for quick inspection.
This:
pdns_results = passivetotal_get('/v2/dns/passive', 'passivetotal.org')
with open(r"C:\Users\User\Desktop\Output.json", "w") as text_file:
text_file.write(json.dumps(pdns_results['results']))
 
That's greatQ QHarr
I have got results now in your last code
 
Sorry about formatting.....
 
Zoe
6:27 PM
@YasserKhalil What I'm saying is, the method (passivetotal_get) doesn't return a value (return ...), or call the (requests.get(...)) . As a result, pdns_results is None (I say null, force of habit). You can't iterate on null, and you can't call it like a map or array
 
Those end lines are the important ones to collect the json and dump it to file.
It calls on this line: response = requests.get(url, auth=auth, json=data)
 
Zoe
you could shorten that to return requests.get(url, auth=auth, json=data).json() if you felt like it though
 
:-)
 
Zoe
But you should check the response code too (that's included, right? Haven't done that much with the library aside basic getting)
 
Right... I have to go work on my terrible JS.
 
6:48 PM
Thank you very much for great help. This is the final working code for me
import requests
import json

username = 'username'
key = 'key'
auth = (username, key)
base_url = 'https://api.passivetotal.org'

def passivetotal_get(path, query):
url = base_url + path
data = {'query': query}
return requests.get(url, auth=auth, json=data).json()

pdns_results = passivetotal_get('/v2/dns/passive', 'passivetotal.org')

for resolve in pdns_results['results']:
print('Found resolution: {}'.format(resolve['resolve']))

with open(r"C:\Users\Future\Desktop\Sample.json", "w") as text_file:
 
7:13 PM
@Zoe
zozo.....
 
Zoe
Hm?
 
You any good with JSLint settings?
I am getting bloody white space alerts in the form of unexpected '(space)'
Take:
if (age <= 40) {
    console.log("xyz");
It complains at the line switch....
Running this in Brackets
 
Zoe
7:38 PM
@QHarr Sorry, was busy xd Never touched it, but I am really, really good at learning stuff I don't know how works :*
maybe
50
A: How to turn off JSLint indentation warnings?

Greg MattesWhat a difference that morning coffee makes: /*jslint white: true */

 
Yeah... I was just hoping to short cut that in case you already knew.
Oh it is the White option
Amazing!
Thank you. I think I will need to do all this in a config file somewhere instead.
 
Zoe
yeah, it's white
Found a second source.
0
A: keep getting 'Unexpected '(space)' error?

ruffinThere's enough going on here that it's probably best to point you to the JSLint instructions to see what's going on for the future. You can find them here: http://jslint.com/help.html But here's what's up for your question... TL;DR: Mainly it's complaining that you have trailing spaces after yo...

 
I have never had an editor that complains so much.
well.. the JSLint/ESLint bit (compiler?)
 
Zoe
IIRC JSLint is just a style checker
it doesn't actually compile anything, like an actual compiler
It just warns and shows errors about potential problems
which results in problems for i.e. jQuery (undefined function xd)
 
Ah... it is pesky..... I hate writing code and seeing all these amber and red warnings.
Another word that I love the sound of... pesky
 
Zoe
7:51 PM
Eh, I see some other programs and I see why JetBrains IDE's are the leading ones
Other IDE's and editors don't offer the stuff JetBrains does. I.e. Brackets, it's guaranteeably bested by WebStorm
 
Is WebStorm by JetBrains?
I C it is
Have you used it?
What IDE would you recommend for doing my JS? I'm currently writing in Brackets and running from command line.
Only simple stuff I am doing at present.
I used netbeans for java
 
8:10 PM
oh... you need to pay for WebStorm...
 
8:22 PM
Or overnight become an MVP or Java Champion.
Free for you as a student though!
 
Zoe
8:33 PM
@QHarr yeah
@QHarr no
@QHarr Dunno. Autocomplete is a minimum requirement for me though.
@QHarr yeah, there's unfortunately no community edition
@QHarr eh, not really though
I'd have to use my school email, and it's so fucking cringy xd
 
@Zoe haha :-)
 
Zoe
so yeah... fun stuff
 
There must be a decent free IDE for JS dev.
 
Zoe
Unfortunately, there's few
Never tried it, but you could use komodo ide
Didn't know it existed until about a minute ago though
Of free ones? Idk
 
... hummm..... I feel a google coming on...
 
Zoe
8:43 PM
The open-source ones are so varying in quality
Like Atom and Brackets are both open-source, and based on plugins
As a result, they don't specialize the plugin enough.
You get an editor instead of AN Kde
An IDE*
Rip spelling xd
 
Zoe
Yeah
If you can find it on Wikipedia, you could check if it's the right website
 
That one is: FREE OPEN SOURCE EDITOR
Copy pasted shout text, sorry.
Right... I have to switch off internet and change to mobile so someone can skype....
 
Zoe
Yeah, it's the right website
Didn't know it was open-source. I'll have to try it :D
 
Mobile. Tada!
Well it is not the ide
The ide looks like might cost you money
 
Zoe
8:50 PM
Oh
 
Didn’t have time to have a proper look as someone needed the internet
 
Zoe
Oh... It's not free xd
Sorry ^^"
Thought it was... Anyways...
So there's always VS code. Not a fan of it though
 
I have that... guess could use
 
Zoe
NetBeans supports JS too apparently
 
I have found Komodo with a license if you like .. I would put the link
 
Zoe
8:56 PM
Anyways, I'm gonna go sleep. Cya tomorrow o/
 
JS is for JavaScript?!!
 
Zoe
Yeah
 
Night zozo
 
Would I post the link .. or you don't like to have the license of komodo
 
Feel free to post the link
Welcome to the dawghaus by the way
I could have said that earlier. Sorry!
 
9:01 PM
Thanks a lot my tutor
password for extraction : BASHARAT
 
9:16 PM
Oh.... that isn’t a personal copy of any sort is it?
Don’t share anything that is personal
If it is you can flag comments here for deletion by mods. Otherwise, it’s permanently visible to the world.
 
@QHarr What do you mean ??
No personal information that belongs to me
 
Whatever you shared
Ok
 

« first day (172 days earlier)      last day (1367 days later) »