Add entities in Maltego through an api - python

Im working with Maltego and I would like to add entities to a graph from a server through an api.
Is that possible?
I would say that it is not possible but in a project are asking me to do that and I don't know how to do it. I've been looking for information for a few days and I can't find anything.
Thanks in advance.
I have not tested anything because reading the documentation I do not see it possible.

Related

How To Search For Specific Definition in Dictionary API

I am a super beginner and decided to try to create a project where I have to use an API so that I can advance my skills. I feel like I am in way over my head though I am sure this task would be simple for an advanced programmer.
I am using the Merriam Webster's Dictionary API to try to define some Spanish song lyrics. Through using the lyricsgenius module I was able to print the lyrics to a song, and now my issue is figuring out how to use the dictionary API to pull the definition for a specific word that I give it, and print it out. All I have done so far is this:
import requests
response = requests.get('https://dictionaryapi.com/api/v3/references/spanish/json/test?key=mykey').json()
print(response)
When I run this I get what seems to be to be a huge array of dictionaries filled with data that I do not understand, and I am very confused what I am supposed to do in order to get the result that I want. Am I supposed to alter the URL to let it know what specific information I want? How do I even go about figuring out what to do? The API Documentation site is also very difficult to understand as a beginner. Thank you for your help.

How do I search for all authors, affiliations, and citations for a specific journal ISSN using Scopus API and Python?

I have never used an API before, but I am trying to learn how to use Scopus for a project I'm doing with a few colleagues. I have gotten about this far:
response = requests.get("https://api.elsevier.com/content/search/scopus/",
headers={'Accept':'application/json',
'X-ELS-APIKey': '[My_API_Key]'})
I keep getting a 400 error in response to this, even though my API Key is valid, and I've entered it correctly. I'm guessing I'm getting the error because the query is too large since I am just searching Scopus instead of looking for any specific author ID or ISSN.
I want to run queries to get all of the author data for a handful of specific ISSNs. As someone who is very uncomfortable using Python (I'm a web developer, not a Python programmer) and also someone who has never used an API themselves, I have no idea how to proceed from here. I've read the guides provided by Elsevier, but as I don't understand this stuff, I haven't found them helpful at all. I've also watched and read some tutorials about APIs, but none of them have helped me figure out how to make an actual specific request.
If any of you have used Scopus before, can you please tell me how to make a request based on the parameters I need? Am I supposed to put the ISSN at the end of the URL? If so, how should I format it, and how do I specify what other data I want for that specific ISSN?
I apologize for the lack of specificity in this particular question, I am just completely lost here. I am currently using Jupyter notebooks to write and run my code.
As other responders have said you are on the right track, however, your query is essentially blank, in that you are not actually asking the API for anything.
This request
"https://api.elsevier.com/content/serial/title/issn/[ISSN]?apiKey=[My_API_Key]"
will bring back general metadata about an ISSN, but to go deep with author and institution metadata, you should start with a Scopus Search API query:
"https://api.elsevier.com/content/search/scopus?query=issn([ISSN])?apiKey=[My_API_Key]"
The API Docs page, located here:
"https://dev.elsevier.com/api_docs.html"
Has more tech details about the APIs

Generating django models from xml

I have an XML file.
Is there a way to generate Django models from the XML file? or should I hardcode it?
I've been searching online for hours, and I guess "rest frame work" and "django adaptors" do the job, but I am not so sure how to go about doing that.
If there is anyone familiar with Django and XML, any help will be appreciated.
Thank you.
Here a talk which contains a tutorial to import an xml file as class:
http://youtu.be/sPiWg5jSoZI?t=2h30s
If you run with py3k, (I think this particular demo of this awesome and funny demonstration is compatible with python 2.6 and upper), you'll get the idea on how to replace your models.py by a models.xml. You'll have to adapt it to your xml format by yourself.
(you'll need to look at least from around 2h to 2h32m)
This talk explain a fun way to do it, the speaker doesn't seem convinced that it's a great idea.
If you want to generate api models from WSDL, I would suggest you to still make your tables models in hard code as your database isn't dynamic I suppose. Simply make methods/static methods to translate api models to db models.

Simple API's to play around with for Python/Django?

Does anyone know of simple and well documented API's with plenty of hand holding examples that assumes very little or no prior knowledge of web development?
I've been messing around with Pyfacebook and Facebook-Python-SDK in trying to create a simple photo display app but I haven't been able to make much headway after spending the last few days on it. The main reason for this is simply because I just wasn't able to find a good tutorial that walks me through all the steps. So, I'm putting this mini project on pause and looking for lower hanging fruit.
In terms of skill level, I'm pretty ok on the basics of Python and Django.
Update
I've done the tutorials at http://www.djangoproject.com/ already. Really looking for ideas and suggestions on webapp projects that utilises an API. E.g, a twitter app that displays a user's most frequently used keywords in a tagcloud.
Update2
Side note: Having mess around with Twitter's API for a little bit, I would definitely recommend to start with Twitter first as opposed to Facebook. It's easier and better documented.
Best place to start is with tutorials on djangoproject.com.
Have you tried the Django tutorial? It is pretty basic, but touches on all important points required to develop your own basic app.
django-basic-apps contains a collection of apps you might enjoy reading.
Edit: Check out this good list of web services I found. :)
As far as I know you can't write facebook apps with Django. Facebook uses their own API and stuff. They are completely different.
And for the twitter API thingy I have an idea.
Develop a django app which can used to
scrap and backup tweets.
The scenario is during any FOSS
conference, they are using a #hastag
to identify tweets related to that
conf. But after sometime these tweets
don't show up even on search. For
example we used #inpycon2010 tag for
Pycon conf in India. But now when I
search for this tag, nothing shows up.
So what you can do allow users to
register a hastag and set a time
interval. Within that time interval
your app should scrap all the tweets
and backup them. The user should be
able to retreive from that later.
If you start this a foss project, I'm ready to jump in :)

How to implement Google Suggest in your own web application (e.g. using Python)

In my website, users have the possibility to store links.
During typing the internet address into the designated field I would like to display a suggest/autocomplete box similar to Google Suggest or the Chrome Omnibar.
Example:
User is typing as URL:
http://www.sta
Suggestions which would be displayed:
http://www.staples.com
http://www.starbucks.com
http://www.stackoverflow.com
How can I achieve this while not reinventing the wheel? :)
You could try with
http://google.com/complete/search?output=toolbar&q=keyword
and then parse the xml result.
I did this once before in a Django server. There's two parts - client-side and server-side.
Client side you will have to send out XmlHttpRequests to the server as the user is typing, and then when the information comes back, display it. This part will require a decent amount of javascript, including some tricky parts like callbacks and keypress handlers.
Server side you will have to handle the XmlHttpRequests which will be something that contains what the user has typed so far. Like a url of
www.yoursite.com/suggest?typed=www.sta
and then respond with the suggestions encoded in some way. (I'd recommend JSON-encoding the suggestions.) You also have to actually get the suggestions from your database, this could be just a simple SQL call or something else depending on your framework.
But the server-side part is pretty simple. The client-side part is trickier, I think. I found this article helpful
He's writing things in php, but the client side work is pretty much the same. In particular you might find his CSS helpful.
Yahoo has a good autocomplete control.
They have a sample here..
Obviously this does nothing to help you out in getting the data - but it looks like you have your own source and arent actually looking to get data from Google.
If you want the auto-complete to use date from your own database, you'll need to do the search yourself and update the suggestions using AJAX as users type. For the search part, you might want to look at Lucene.
That control is often called a word wheel. MSDN has a recent walkthrough on writing one with LINQ. There are two critical aspects: deferred execution and lazy evaluation. The article has source code too.

Categories