Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdual committed Aug 10, 2024
1 parent f38f7f8 commit c7af969
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,22 @@ handler = urllib.request.urlopen(request)
response = handler.read().decode('utf-8')
```

# Options

You can define options for the "options" parameter for further customization.

```python
import ua_generator
from ua_generator.options import Options

ua_options = Options(weighted_versions=True)
ua = ua_generator.generate(browser=('chrome', 'edge'), options=ua_options)
```

## Parameters

- **weighted_versions (bool):** Increases the probability of latest versions being chosen. Default is `False`.

# Issues

You can create an issue [from here](https://github.com/iamdual/ua-generator/issues) if you are experiencing a problem.
Expand Down
5 changes: 5 additions & 0 deletions src/ua_generator/data/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
Random User-Agent
Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual)
License: Apache License 2.0
"""
import random
from typing import Union

Expand Down
7 changes: 7 additions & 0 deletions src/ua_generator/options.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Random User-Agent
Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual)
License: Apache License 2.0
"""


class Options:
weighted_versions = False

Expand Down

0 comments on commit c7af969

Please sign in to comment.