{"action":"created","issue":{"url":"https://api.github.com/repos/MISP/MISP/issues/770","labels_url":"https://api.github.com/repos/MISP/MISP/issues/770/labels{/name}","comments_url":"https://api.github.com/repos/MISP/MISP/issues/770/comments","events_url":"https://api.github.com/repos/MISP/MISP/issues/770/events","html_url":"https://github.com/MISP/MISP/issues/770","id":122882425,"number":770,"title":"Question...Using pymisp to get returned data into MISP?","user":{"login":"mathurin68","id":5932961,"avatar_url":"https://avatars.githubusercontent.com/u/5932961?v=3","gravatar_id":"","url":"https://api.github.com/users/mathurin68","html_url":"https://github.com/mathurin68","followers_url":"https://api.github.com/users/mathurin68/followers","following_url":"https://api.github.com/users/mathurin68/following{/other_user}","gists_url":"https://api.github.com/users/mathurin68/gists{/gist_id}","starred_url":"https://api.github.com/users/mathurin68/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathurin68/subscriptions","organizations_url":"https://api.github.com/users/mathurin68/orgs","repos_url":"https://api.github.com/users/mathurin68/repos","events_url":"https://api.github.com/users/mathurin68/events{/privacy}","received_events_url":"https://api.github.com/users/mathurin68/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/MISP/MISP/labels/support","name":"support","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-18T05:34:56Z","updated_at":"2015-12-19T12:33:24Z","closed_at":null,"body":"Still learning python... if I have data that I have already normalized, i.e. I can take the data returned from my function and 'curl' it into MISP.  But I really want to do it automatically using pymisp but I'm new to python and have no idea where to start --\r\n\r\nThis is the end of the program with the data I've normalized, I can take what's returned from print json.dumps(data) and 'curl' this into MISP.  My question is I have no idea where to go from here if I want import pymisp and add the results of the def process_item(self, item, spider) function through pymisp how do I do this?  I know I need post, request, add_event etc.  but how do I call api.py, etc.  \r\n\r\n    import scrapy\r\n    from scrapy.http import Request\r\n    import requests \r\n    import json\r\n    import jsonpickle\r\n    from collections import defaultdict\r\n    from hybridanalysis.items import HybridAnalysis\r\n    from pymisp import PyMISP\r\n    from keys import misp_url, misp_key\r\n\r\n\r\n    class HybridanalysisPipeline(object):\r\n        \tdef process_item(self, item, spider):\r\n\t        \tdata = {}\r\n          \t\tdata['Event'] = dict(item)\r\n\t\t        attributes = data[\"Event\"][\"Attribute\"]\r\n\t\t        data[\"Event\"][\"Attribute\"] = []\r\n\t\t        for attribute in attributes:\r\n\t\t\t     for value in attribute[\"value\"]:\r\n\t\t\t\t     new_attr = attribute.copy()\r\n\t\t\t\t    new_attr[\"value\"] = value\r\n\t\t\t\t    print \"value added to new_attr\"\r\n\t\t\t\t    data[\"Event\"][\"Attribute\"].append(new_attr)\r\n\t\t\t\t    print type(data[\"Event\"][\"Attribute\"])\r\n\t\t    print json.dumps(data)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/MISP/MISP/issues/comments/165981675","html_url":"https://github.com/MISP/MISP/issues/770#issuecomment-165981675","issue_url":"https://api.github.com/repos/MISP/MISP/issues/770","id":165981675,"user":{"login":"Rafiot","id":248875,"avatar_url":"https://avatars.githubusercontent.com/u/248875?v=3","gravatar_id":"","url":"https://api.github.com/users/Rafiot","html_url":"https://github.com/Rafiot","followers_url":"https://api.github.com/users/Rafiot/followers","following_url":"https://api.github.com/users/Rafiot/following{/other_user}","gists_url":"https://api.github.com/users/Rafiot/gists{/gist_id}","starred_url":"https://api.github.com/users/Rafiot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rafiot/subscriptions","organizations_url":"https://api.github.com/users/Rafiot/orgs","repos_url":"https://api.github.com/users/Rafiot/repos","events_url":"https://api.github.com/users/Rafiot/events{/privacy}","received_events_url":"https://api.github.com/users/Rafiot/received_events","type":"User","site_admin":false},"created_at":"2015-12-19T12:33:24Z","updated_at":"2015-12-19T12:33:24Z","body":"Yeah, the complexity of creating a valid json object is hidden by the API.\r\nTo help you, I'll need a non-working json object you try to push (`eventdata` in your case) and if you can dump the error message you receive from the server and the logerror, that would be very helpful.\r\n\r\nAlso, if you're not already doing it, please use MISP 2.4 "}}