Coder Social home page Coder Social logo

googlesearchr's Introduction

GoogleSearchR

GoogleSearchR is an R package that provides functions to query Google and extract information from search results. With this package, you can easily extract data from Google search results and integrate it into your R workflow. Try it out today and see how it can improve your productivity!

GitHub license GitHub issues GitHub stars

Installation

You can install this package using the devtools package:

devtools::install_github("irfanalidv/GoogleSearchR")

Usage

library(GoogleSearchR)

# Example usage
df <- data.frame(
  Organization_Name = c("Walmart", "First Republic Bank", "Netflix", "Amazon", "Snap", "Comcast", "Apple"),
  Headquarters_Location = c("Bentonville, Arkansas, United States", "San Francisco, California, United States", "Los Gatos, California, United States", "Seattle, Washington, United States", "Venice, California, United States", "Philadelphia, Pennsylvania, United States", "Cupertino, California, United States")
)

df$concat_cols <- concat_cols(df, "Organization_Name", "Headquarters_Location", sep = " + ")
df$website  <- sapply(df$concat_cols, get_first_google_link)

Functions

get_first_google_link(name, root = TRUE)

This function takes a search term name and returns the first Google search result link.

Arguments:

  • name: The search term to query Google.
  • root: A boolean indicating whether to return the root domain of the link.

concat_cols(df, col1, col2, sep = "+")

This function concatenates two columns of a data frame with a user-defined separator.

Arguments:

  • df: The data frame containing the columns to concatenate.
  • col1: The name of the first column to concatenate.
  • col2: The name of the second column to concatenate.
  • sep: The separator to use between the two columns.

Dependencies

This package depends on the following R packages:

  • curl
  • remotes
  • utils
  • urltools
  • rvest
  • dplyr
  • xml2

googlesearchr's People

Contributors

irfanalidv avatar

Watchers

 avatar

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.