Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/utm-link-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: UTM link lint

on:
pull_request:
push:
branches:
- main
workflow_dispatch:

jobs:
utm-link-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Checkout common-ci
uses: actions/checkout@v4
with:
repository: 51Degrees/common-ci
path: utm-lint-common-ci

- name: Lint 51degrees.com links
shell: pwsh
run: ./utm-lint-common-ci/scripts/utm-lint.ps1 -RepoRoot .
4 changes: 2 additions & 2 deletions ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ This API complies with the `common-ci` approach.
The following secrets are required:
* `ACCESS_TOKEN` - GitHub [access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#about-personal-access-tokens) for cloning repos, creating PRs, etc.
* Example: `github_pat_l0ng_r4nd0m_s7r1ng`
* `SUPER_RESOURCE_KEY` - [resource key](https://51degrees.com/documentation/4.4/_info__resource_keys.html) for integration tests
* `SUPER_RESOURCE_KEY` - [resource key](https://51degrees.com/documentation/_info__resource_keys.html?utm_source=github&utm_medium=readme&utm_campaign=device-detection-python&utm_content=ci-readme.md&utm_term=api-specific-ci-cd-approach) for integration tests
* Example: `R4nd0m-S7r1ng`
* `DEVICE_DETECTION_KEY` - [license key](https://51degrees.com/pricing) for downloading assets (TAC hashes file and TAC CSV data file)
* `DEVICE_DETECTION_KEY` - [license key](https://51degrees.com/pricing?utm_source=github&utm_medium=readme&utm_campaign=device-detection-python&utm_content=ci-readme.md&utm_term=api-specific-ci-cd-approach) for downloading assets (TAC hashes file and TAC CSV data file)
* Example: `V3RYL0NGR4ND0M57R1NG`
* `PYPI_TOKEN` - [PyPI token](https://pypi.org/help/#apitoken) for publishing packages
* Example: `pypi-sUp3r-l0nG_r4nd0m-s7r1Ng`
Expand Down
4 changes: 2 additions & 2 deletions fiftyone_devicedetection/readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 51Degrees Device Detection Engines - Device Detection

![51Degrees](https://51degrees.com/DesktopModules/FiftyOne/Distributor/Logo.ashx?utm_source=github&utm_medium=repository&utm_content=readme_main&utm_campaign=python-open-source "THE Fastest and Most Accurate Device Detection") **v4 Device Detection Python**
![51Degrees](https://51degrees.com/img/logo.png?utm_source=github&utm_medium=readme&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection-readme.md&utm_term=51degrees-device-detection-engines-device-detection "THE Fastest and Most Accurate Device Detection") **v4 Device Detection Python**

[Developer Documentation](https://51degrees.com/device-detection-python/index.html?utm_source=github&utm_medium=repository&utm_content=property_dictionary&utm_campaign=python-open-source "Developer Documentation") | [Available Properties](https://51degrees.com/resources/property-dictionary?utm_source=github&utm_medium=repository&utm_content=property_dictionary&utm_campaign=python-open-source "View all available properties and values")
[Developer Documentation](https://51degrees.com/device-detection-python/index.html?utm_source=github&utm_medium=readme&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection-readme.md&utm_term=51degrees-device-detection-engines-device-detection "Developer Documentation") | [Available Properties](https://51degrees.com/resources/property-dictionary?utm_source=github&utm_medium=readme&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection-readme.md&utm_term=51degrees-device-detection-engines-device-detection "View all available properties and values")

## Introduction

Expand Down
2 changes: 1 addition & 1 deletion fiftyone_devicedetection/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def read(file_name):
version=read("version.txt"),
author="51Degrees Engineering",
author_email="engineering@51degrees.com",
url="https://51degrees.com/",
url="https://51degrees.com/?utm_source=pypi&utm_medium=package&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection-setup.py&utm_term=url",
description=("51Degrees Device Detection parses HTTP headers to return detailed hardware, operating system, browser, and crawler information for the devices used to access your website or service. This is an alternative to popular UAParser, DeviceAtlas, and WURFL packages."),
long_description=read("readme.md"),
long_description_content_type='text/markdown',
Expand Down
8 changes: 4 additions & 4 deletions fiftyone_devicedetection_cloud/readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 51Degrees Device Detection Engines - Cloud

![51Degrees](https://51degrees.com/DesktopModules/FiftyOne/Distributor/Logo.ashx?utm_source=github&utm_medium=repository&utm_content=readme_main&utm_campaign=python-open-source "THE Fastest and Most Accurate Device Detection") **v4 Device Detection Python**
![51Degrees](https://51degrees.com/img/logo.png?utm_source=github&utm_medium=readme&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_cloud-readme.md&utm_term=51degrees-device-detection-engines-cloud "THE Fastest and Most Accurate Device Detection") **v4 Device Detection Python**

[Developer Documentation](https://51degrees.com/device-detection-python/index.html?utm_source=github&utm_medium=repository&utm_content=property_dictionary&utm_campaign=python-open-source "Developer Documentation") | [Available Properties](https://51degrees.com/resources/property-dictionary?utm_source=github&utm_medium=repository&utm_content=property_dictionary&utm_campaign=python-open-source "View all available properties and values")
[Developer Documentation](https://51degrees.com/device-detection-python/index.html?utm_source=github&utm_medium=readme&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_cloud-readme.md&utm_term=51degrees-device-detection-engines-cloud "Developer Documentation") | [Available Properties](https://51degrees.com/resources/property-dictionary?utm_source=github&utm_medium=readme&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_cloud-readme.md&utm_term=51degrees-device-detection-engines-cloud "View all available properties and values")

## Introduction

Expand All @@ -12,7 +12,7 @@

You can confirm this is working with the following micro-example.

* Create a resource key for free with the 51Degrees [configurator](https://configure.51degrees.com/np5M4nlF). This defines the properties you want to access.
* Create a resource key for free with the 51Degrees [configurator](https://configure.51degrees.com/np5M4nlF?utm_source=github&utm_medium=readme&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_cloud-readme.md&utm_term=from-pypi). This defines the properties you want to access.
* On the 'implement' page of the configurator, copy the resource key and replace YOUR_RESOURCE_KEY in the example below. Save this as exampledd.py
* Run the example with `python exampledd.py`
* Feel free to try different user-agents and property values.
Expand All @@ -26,7 +26,7 @@ fd.process()
print(fd.device.ismobile.value())
```

For more in-depth examples, check out the [examples](https://51degrees.com/device-detection-python/examples.html) page in the documentation.
For more in-depth examples, check out the [examples](https://51degrees.com/device-detection-python/examples.html?utm_source=github&utm_medium=readme&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_cloud-readme.md&utm_term=from-pypi) page in the documentation.

### From GitHub

Expand Down
2 changes: 1 addition & 1 deletion fiftyone_devicedetection_cloud/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def read(file_name):
version=read("version.txt"),
author="51Degrees Engineering",
author_email="engineering@51degrees.com",
url="https://51degrees.com/",
url="https://51degrees.com/?utm_source=pypi&utm_medium=package&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_cloud-setup.py&utm_term=url",
description=("51Degrees Device Detection parses HTTP headers to return detailed hardware, operating system, browser, and crawler information for the devices used to access your website or service. This package retrieves device detection results by consuming the 51Degrees cloud service."),
long_description=read("readme.md"),
long_description_content_type='text/markdown',
Expand Down
4 changes: 2 additions & 2 deletions fiftyone_devicedetection_examples/readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 51Degrees Device Detection Engines - Examples

![51Degrees](https://51degrees.com/DesktopModules/FiftyOne/Distributor/Logo.ashx?utm_source=github&utm_medium=repository&utm_content=readme_main&utm_campaign=python-open-source "THE Fastest and Most Accurate Device Detection") **v4 Device Detection Python**
![51Degrees](https://51degrees.com/img/logo.png?utm_source=github&utm_medium=readme&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_examples-readme.md&utm_term=51degrees-device-detection-engines-examples "THE Fastest and Most Accurate Device Detection") **v4 Device Detection Python**

[Developer Documentation](https://51degrees.com/device-detection-python/index.html?utm_source=github&utm_medium=repository&utm_content=property_dictionary&utm_campaign=python-open-source "Developer Documentation") | [Available Properties](https://51degrees.com/resources/property-dictionary?utm_source=github&utm_medium=repository&utm_content=property_dictionary&utm_campaign=python-open-source "View all available properties and values")
[Developer Documentation](https://51degrees.com/device-detection-python/index.html?utm_source=github&utm_medium=readme&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_examples-readme.md&utm_term=51degrees-device-detection-engines-examples "Developer Documentation") | [Available Properties](https://51degrees.com/resources/property-dictionary?utm_source=github&utm_medium=readme&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_examples-readme.md&utm_term=51degrees-device-detection-engines-examples "View all available properties and values")

## Introduction

Expand Down
2 changes: 1 addition & 1 deletion fiftyone_devicedetection_examples/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def read(file_name):
version=read("version.txt"),
author="51Degrees Engineering",
author_email="engineering@51degrees.com",
url="https://51degrees.com/",
url="https://51degrees.com/?utm_source=pypi&utm_medium=package&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_examples-setup.py&utm_term=url",
description=("The 51Degrees Pipeline API is a generic web request intelligence and data processing solution with the ability to add a range of 51Degrees and/or custom plug ins (Engines). "
"This project contains examples of using 51Degrees Device Detection engines with the Pipeline API"),
long_description=read("readme.md"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
from fiftyone_devicedetection.devicedetection_pipelinebuilder import DeviceDetectionPipelineBuilder
from fiftyone_devicedetection_examples.example_utils import ExampleUtils

# This example is displayed at the end of the [Configurator](https://configure.51degrees.com/)
# This example is displayed at the end of the [Configurator](https://configure.51degrees.com/?utm_source=code&utm_medium=example&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_examples-src-fiftyone_devicedetection_examples-cloud-configurator_console.py&utm_term=top)
# process, which is used to create resource keys for use with the 51Degrees cloud service.
#
# It shows how to call the cloud with the newly created key and how to access the values
# of the selected properties.
#
# See [Getting Started](https://51degrees.com/documentation/_examples__device_detection__getting_started__console__cloud.html)
# See [Getting Started](https://51degrees.com/documentation/_examples__device_detection__getting_started__console__cloud.html?utm_source=code&utm_medium=example&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_examples-src-fiftyone_devicedetection_examples-cloud-configurator_console.py&utm_term=top)
# for a fuller example.
#
# Required PyPi Dependencies:
Expand Down Expand Up @@ -92,10 +92,10 @@ def main(argv):
f"'{ExampleUtils.RESOURCE_KEY_ENV_VAR}'. The 51Degrees " +
"cloud service is accessed using a 'ResourceKey'. " +
"For more detail see " +
"http://51degrees.com/documentation/4.3/_info__resource_keys.html. " +
"https://51degrees.com/documentation/_info__resource_keys.html?utm_source=code&utm_medium=example&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_examples-src-fiftyone_devicedetection_examples-cloud-configurator_console.py&utm_term=resource-key-required. " +
"A resource key with the properties required by this " +
"example can be created for free at " +
"https://configure.51degrees.com/1QWJwHxl. " +
"https://configure.51degrees.com/1QWJwHxl?utm_source=code&utm_medium=example&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_examples-src-fiftyone_devicedetection_examples-cloud-configurator_console.py&utm_term=resource-key-required. " +
"Once complete, populate the environment variable " +
"mentioned at the start of this message with the key.")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

# First create the device detection pipeline with the desired settings.

# You need to create a resource key at https://configure.51degrees.com
# You need to create a resource key at https://configure.51degrees.com?utm_source=code&utm_medium=example&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_examples-src-fiftyone_devicedetection_examples-cloud-failuretomatch.py&utm_term=top
# and paste it into the code, replacing !!YOUR_RESOURCE_KEY!! below.
# Alternatively, add a resource_key environment variable
import os
Expand All @@ -36,9 +36,9 @@
if resource_key == "!!YOUR_RESOURCE_KEY!!":
print("""
You need to create a resource key at
https://configure.51degrees.com and paste it into the code,
https://configure.51degrees.com?utm_source=code&utm_medium=example&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_examples-src-fiftyone_devicedetection_examples-cloud-failuretomatch.py&utm_term=resource-key-required and paste it into the code,
'replacing !!YOUR_RESOURCE_KEY!!
To include the properties used in this example, go to https://configure.51degrees.com/bxXqZhLT
To include the properties used in this example, go to https://configure.51degrees.com/bxXqZhLT?utm_source=code&utm_medium=example&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_examples-src-fiftyone_devicedetection_examples-cloud-failuretomatch.py&utm_term=resource-key-required
""")
else:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"elementParameters": {
"settings": {
// Obtain a resource key with the properties required to run this
// example for free: https://configure.51degrees.com/1QWJwHxl
// example for free: https://configure.51degrees.com/1QWJwHxl?utm_source=code&utm_medium=example&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_examples-src-fiftyone_devicedetection_examples-cloud-gettingstarted_console.json&utm_term=settings
"resource_key": "!!ENTER_YOUR_RESOURCE_KEY_HERE!!",
"cloud_request_origin": "51Degrees.example.com"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def run(self, config, logger, output):

# In this example, we use the PipelineBuilder and configure it from a file.
# For more information about builders in general see the documentation at
# https://51degrees.com/documentation/_concepts__configuration__builders__index.html
# https://51degrees.com/documentation/_concepts__configuration__builders__index.html?utm_source=code&utm_medium=example&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_examples-src-fiftyone_devicedetection_examples-cloud-gettingstarted_console.py&utm_term=run

# Create the pipeline using the service provider and the configured options.
pipeline = PipelineBuilder().add_logger(logger).build_from_configuration(config)
Expand Down Expand Up @@ -97,7 +97,7 @@ def analyseEvidence(self, evidence, pipeline, output):

# Display the results of the detection, which are called
# device properties. See the property dictionary at
# https://51degrees.com/developers/property-dictionary
# https://51degrees.com/developers/property-dictionary?utm_source=code&utm_medium=example&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_examples-src-fiftyone_devicedetection_examples-cloud-gettingstarted_console.py&utm_term=analyseevidence
# for details of all available properties.
self.outputValue("Mobile Device", device.ismobile, message)
self.outputValue("Platform Name", device.platformname, message)
Expand Down Expand Up @@ -175,9 +175,9 @@ def main(argv):
f"'{ExampleUtils.RESOURCE_KEY_ENV_VAR}'. The 51Degrees cloud " +
"service is accessed using a 'ResourceKey'. For more information " +
"see " +
"https://51degrees.com/documentation/_info__resource_keys.html. " +
"https://51degrees.com/documentation/_info__resource_keys.html?utm_source=code&utm_medium=example&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_examples-src-fiftyone_devicedetection_examples-cloud-gettingstarted_console.py&utm_term=resource-key-required. " +
"A resource key with the properties required by this example can be " +
"created for free at https://configure.51degrees.com/1QWJwHxl. " +
"created for free at https://configure.51degrees.com/1QWJwHxl?utm_source=code&utm_medium=example&utm_campaign=device-detection-python&utm_content=fiftyone_devicedetection_examples-src-fiftyone_devicedetection_examples-cloud-gettingstarted_console.py&utm_term=resource-key-required. " +
"Once complete, populate the config file or environment variable " +
"mentioned at the start of this message with the key.")
else:
Expand Down
Loading
Loading