Comments (4)
from pysocialwatcher.
Right. I understand the difference between "and" and "or" but I can't figure out how to write the JSON query to issue an "and" query.
from pysocialwatcher.
I added a hacky fix to utils.select_advance_targeting_type_array_ids
:
if input_value.has_key("and"):
for id_and in input_value["and"]:
## TODO: make the behavior AND query request less hacky
if(segment_type == constants.INPUT_BEHAVIOR_FIELD):
if(len(targeting['flexible_spec']) == 1):
targeting['flexible_spec'].append({api_field_name : []})
targeting['flexible_spec'][1][api_field_name].append({"id" : id_and})
else:
targeting["flexible_spec"].append({segment_type: {"id" : id_and}})
from pysocialwatcher.
Hi there,
I run into problems with the AND in the behavior field as well.
When using the json provided by @ianbstewart and the current GitHub version (which included this fix), I get the following error:
File "/home/palotti/p2/local/lib/python2.7/site-packages/pysocialwatcher-0.1j-py2.7.egg/pysocialwatcher/utils.py", line 375, in select_advance_targeting_type_array_ids targeting['flexible_spec'][1][api_field_name].append({"id" : id_and}) IndexError: list index out of range
Do you guys get this error as well?
I suggest the following modification instead:
joaopalotti@bff9fe0
(Now it does work here, but it probably needs to be tested elsewhere).
Cheers,
Joao
from pysocialwatcher.
Related Issues (15)
- Facebook changed interests. Error Code:100 HOT 4
- Deprecated API?
- Problem in Execution HOT 4
- How to handle "Sorry, something went wrong." HOT 1
- (noob q): unable to install
- (noob q): unable to install HOT 5
- "Param currency on field delivery_estimate" Error HOT 2
- deprecated version of the Ads API? HOT 3
- ads API v8.0 HOT 3
- Deprecated API
- Requests greater than 300 HOT 3
- WARNING Facebook Error code 2 HOT 1
- MINOR ISSUE: Innacurate documentation of SLEEP constant HOT 1
- Response doesn't return JSON HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pysocialwatcher.