Git Product home page Git Product logo

Comments (3)

vladfaust avatar vladfaust commented on June 8, 2024

Great! Unity has SystemInfo.operatingSystem. Should its output be formatted before sent to WakaTime? For example, "Windows 7 (6.1.7601) 64bit"...

from unity-wakatime.

Hermesiss avatar Hermesiss commented on June 8, 2024
  1. I need a list of operating systems that are in use in Wakatime. Rider and VsCode use Windows, we cant break this by adding details. Or maybe we should?
  2. I found only 2 ways to monitor OSs - in Timeless android app and embedded section, both are not quite convenient for testing

from unity-wakatime.

alanhamlett avatar alanhamlett commented on June 8, 2024

The User Agent API Endpoint is a good way to see how the user agent string sent from plugins (aka value) is translated into an operating system (aka os). The three operating systems supported on WakaTime dashboards are Mac, Windows, and Linux. Here's the Python code used on the server to translate user agent value string into an os:

class UserAgent(Model):
    id = db.Column(UUID(), primary_key=True, default=uuid.uuid4)
    user_id = db.Column(UUID(), db.ForeignKey('user.id'), nullable=False)
    value = db.Column(db.String(600), nullable=False)
    last_seen = db.Column(db.DateTime())
    created_at = db.Column(db.DateTime(), nullable=False, default=datetime.utcnow)
    __table_args__ = (
        db.UniqueConstraint('user_id', 'value'),
    )

    @property
    def os(self):
        os = None
        try:
            ua = self.value.lower()
            if 'darwin' in ua or 'macintosh' in ua:
                os = 'Mac'
            elif 'windows' in ua:
                os = 'Windows'
            elif 'linux' in ua or 'bsd' in ua or 'unix' in ua:
                os = 'Linux'
        except:
            pass
        return os

from unity-wakatime.

Related Issues (20)

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.