Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract data from group #40

Closed
MLMarins opened this issue Oct 4, 2017 · 2 comments
Closed

Extract data from group #40

MLMarins opened this issue Oct 4, 2017 · 2 comments

Comments

@MLMarins
Copy link

MLMarins commented Oct 4, 2017

Hello,

I went through the DEMO and I thought I could download all queries in a group, but in practice I got this error:
('No valid queries ids could be extracted', 'MyGroup')

In bwresources.py, it says:
def get_mention(self, **kwargs): Retrieves a single mention by url or resource id. This is ONLY a valid function for queries (not groups), which is why it isn't split out into bwdata.

Well, is there a way to download the data from all queries in a group in one call? Or at least interact with a list of queries?

Thanks!

@amybarker
Copy link
Contributor

Yes - there is!

To download the data from all queries in a group in one call, use the get_mentions() function. You can achieve this in the DEMO by editing the first get_mentions() call in the 'Downloading Data' section to be run on groups instead of queries, and passing in a group name (see screenshot attached)

There are two similarly named functions, which I think you've confused above.
get_mentions() retrieves a list of mentions, works on both queries and groups, and is defined in the bwdata.py file
get_mention() retrieves only one mention by looking up a url or id, only works on queries, and is defined in the bwresources.py file
Here, you want to use the get_mentions() function.

Hope that helps!

screen shot 2017-10-27 at 11 37 52 am

@MLMarins
Copy link
Author

Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants