Coder Social home page Coder Social logo

brandwatchr's People

Contributors

j450h1 avatar phippsy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

j450h1

brandwatchr's Issues

bwr_query_create and bwr_query_delete not working

Code being run:

brandwatchR::bwr_auth(un = "XXXX",
                      pw = "XXXX")

my_projects <- bwr_projects_get()
head(my_projects)

(my_project <- bwr_projects_get()$id)

(my_query <- bwr_query_get(project_id = my_project)$id)


bwr_query_create(project_id = my_project,
                 samplePercent = 50,
                 includedTerms = 'at_mentions:mickeymouse',
                 name = 'test1')

output:

Error in bwr_query_create(project_id = my_project, samplePercent = 50,  : 
  Bad Request (HTTP 400).

No issues until I run bwr_query_create.

Snippets not showing

I was able to pull data for a specific project and query, and all other fields appear to pull successfully, but the snippet does not appear (it shows as NA). When I use a curl statement to pull the same data via the API, the snippets are successfully pulled.

Here is the sample of the code I am running
library(brandwatchR)
library(jsonlite)
library(dplyr)
library(lubridate)

bwr_auth(un = "#############@##############", pw = rstudioapi::askForPassword())

my_project <- bwr_projects_get()$id[2]

my_query <- bwr_query_get(project_id = my_project)$id[4] #4

my_mentions_test <- bwr_mentions_get(project_id = my_project,
query_id = my_query,
filters = list(gender = "female", sentiment = 'neutral'), #, twitterVerified = TRUE),
order_by = 'sentiment', order_direction = 'asc',
page = 0,
date_range = c('2019-01-30', '2019-01-31'))

Error: Bad Request

I've been getting Error: Bad Request (HTTP 400) each time I try to login. Has anyone else had this issue?

issue with pagging

Hi,

When I run the following code:

bwr_mentions_get( project_id = 1998216861, query_id = 1999369154, page = 0)

It automatically tries to see/check the next page i.e. 1 in this case.
This throws an error:

No encoding supplied: defaulting to UTF-8. Error in vapply(x, obj_sum, character(1L)) : values must be length 1, but FUN(X[[1]]) result is length 0

After checking with the de-bugger:

here is the error:

if (dim(results)[1] >= 5000) { results <- data.table::rbindlist(list(results, bwr_mentions_get(project_id = project_id, query_id = query_id, date_range = date_range, page = json$resultsPage + 1)), fill = TRUE) }

Could we get it fixed please?

dates not pulling

hi I am trying to pull some brandwatch mentions data with this package and everything seems to be working fine except in the data column a lot of values are coming up as NA. here is my code:

library(brandwatchR)
library(dplyr)
library(xlsx)

setwd("")

bwr_auth(un = "",
pw = "",
refresh = FALSE,
cache = FALSE)

View(bwr_cat_get(
project_id =
))

my_projects <- bwr_projects_get()
head(my_projects)

my_mentions1 <- bwr_mentions_get(
project_id = ,
query_id = ,
date_range = c("2019-04-01", "2019-08-12"))

my_mentions2 <- bwr_mentions_get(
project_id = ,
query_id = ,
date_range = c("2019-03-01", "2019-04-01"))

my_mentions3 <- bwr_mentions_get(
project_id = ,
query_id = ,
date_range = c("2019-01-20", "2019-03-01"))

my_mentions4 <- bwr_mentions_get(
project_id = ,
query_id = ,
date_range = c("2019-01-18", "2019-01-20"))

my_mentions5 <- bwr_mentions_get(
project_id = ,
query_id = ,
date_range = c("2019-01-17", "2019-01-18"))

my_mentions6 <- bwr_mentions_get(
project_id = ,
query_id = ,
date_range = c("2018-10-1", "2019-01-12"))

glimpse(my_mentions1)

library(dplyr)
my_mentions1 <- my_mentions1 %>%
as_tibble %>%
select(date, sentiment, categories)

my_mentions2 <- my_mentions2 %>%
as_tibble %>%
select(date, sentiment, categories)

my_mentions3 <- my_mentions3 %>%
as_tibble %>%
select(date, sentiment, categories)

my_mentions4 <- my_mentions4 %>%
as_tibble %>%
select(date, sentiment, categories)

my_mentions5 <- my_mentions5 %>%
as_tibble %>%
select(date, sentiment, categories)

my_mentions6 <- my_mentions6 %>%
as_tibble %>%
select(date, sentiment, categories)

my_mentions <- bind_rows(my_mentions1, my_mentions2, my_mentions3, my_mentions4, my_mentions5, my_mentions6)

write.csv(as.matrix(my_mentions), "mentions.csv")

(I have removed project/ query ID and name and password/ setwd)

The resulting CSV is a file with some dates, but most of them are filled with NA.

Any help would be really appreciated!

groups dataframe - Error in is.finite(x[[idx]]) : default method not implemented for type 'list'

Congrats on new package!

Small error here when I try to view the my_groups dataframe:

#install.packages('brandwatchR')
library(brandwatchR)
library(jsonlite)
library(dplyr)

brandwatch_credentials <- file.path("..", "credentials", "brandwatch.json")

bw <- jsonlite::fromJSON(brandwatch_credentials)

# Authenticate

bwr_auth(un= bw$USERNAME,
         pw= bw$PASSWORD,
         refresh = TRUE,
         cache = TRUE)

# Get projects
my_projects <- bwr_projects_get()
#head(my_projects)

PROJECT <- my_projects %>% filter(name == bw$PROJECT) %>% pull(id)

# Get groups
my_groups <- bwr_querygrp_get(project_id = PROJECT)
View(my_groups)

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.