GithubHelp home page GithubHelp logo

podcast-agent's Introduction

Podcast Agents

This is library is for identifying entities that download or stream podcast episodes. For lack of a better term, these will be referred to as Podcast Agents. Podcast Agents include apps, bots, and browsers.

Identification

In order to identify a Podcast Agent, we will be using the user-agent and/or referrer. The code will attempt to match the podcast agent by comparing the user-agent before attempting to match the referrer. This information will be compared to a database of Podcast Agents and will result in one and only one match.

Name: Name of the Podcast Agent that matches the database

Browser: Browser as parsed by UserAgent GEM

Platform: Platform as parsed by UserAgent GEM

Installation

gem install podcast-agent

Examples

Stitcher on Safari

user_agent_string = 'Mozilla/5.0 (iPad; CPU OS 12_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Pandora/1908.1'
referrer = 'https://app.stitcher.com/'
podcast_agent = PodcastAgentParser.find_by(user_agent_string: user_agent_string,
                                     referrer: referrer)
podcast_agent.name
# => 'Stitcher'
podcast_agent.browser
# => 'Safari'
podcast_agent.platform
# => 'iPad'

Pandora on Safari

user_agent_string = 'Mozilla/5.0 (iPad; CPU OS 12_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Pandora/1908.1'
podcast_agent = PodcastAgentParser.find_by(user_agent_string: user_agent_string)
podcast_agent.name
# => 'Pandora'
podcast_agent.browser
# => 'Safari'
podcast_agent.platform
# => 'iPad'

Apple Home Pod

user_agent_string = 'AppleCoreMedia/1.0.0.15C4092b (HomePod; U; CPU OS 11_2 like Mac OS X; de_de)'
podcast_agent = PodcastAgentParser.find_by(user_agent_string: user_agent_string)
podcast_agent.name
# => 'Apple HomePod'
podcast_agent.browser
# => 'AppleCoreMedia'
podcast_agent.platform
# => 'HomePod'

podcast-agent's People

Contributors

buzzsprout avatar tomrossi7 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.