GithubHelp home page GithubHelp logo

Comments (6)

mgoffin avatar mgoffin commented on July 27, 2024 1

Thanks for letting me know! I suspect defaulting those will no longer work with ThreatTag being added to the mix. Since those are the defaults I'll rework the logic to only include them if they are set to a non-default value (true).

from threatexchange.

mgoffin avatar mgoffin commented on July 27, 2024

@seanthegeek I am doing the following:

>>> from pytx import ThreatTag
>>> ts = ThreatTag.objects(text='malware', request_dict=True)
>>> ts
{'url': 'https://graph.facebook.com/v2.8/threat_tags/?text=malware&strict_text=false&include_expired=false', 'body': None, 'type': 'GET'}
>>> ts = ThreatTag.objects(text='malware')
>>> count = 0
>>> for t in ts:
...     count += 1
...
>>> count
5
>>>

It seems to be working for me, however I might be reproducing wrong. Could you provide an example request using pytx code that causes the HTTP 500 error? Thanks!

from threatexchange.

seanthegeek avatar seanthegeek commented on July 27, 2024

Maybe it's because I'm trying to get a list of all tags?

`
from pytx import ThreatTag

count = 0
results = ThreatTag.objects()
for result in results:
count += 1
print(count)`

from threatexchange.

mgoffin avatar mgoffin commented on July 27, 2024

Correct. You need to provide some sort of text to search on. If you put this in your browser:

https://graph.facebook.com/v2.8/threat_tags/?access_token=foo|bar

replacing with your access token, you'll see the same error coming back.

from threatexchange.

seanthegeek avatar seanthegeek commented on July 27, 2024

Ah, in that case, I wonder why pytxFetchError is not raised like in is when missing attributes for ThreatDiscriptor?

from threatexchange.

mgoffin avatar mgoffin commented on July 27, 2024

I suspect because with ThreatDescriptor you aren't required to have a value in the text parameter if you include date ranges. I'd have to go back and check to see why it's not tripping.

from threatexchange.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.