Coder Social home page Coder Social logo

bonbast's Introduction

Hi there ๐Ÿ‘‹

  • ๐ŸŒฑ Iโ€™m currently learning Flutter
  • ๐Ÿ“ซ How to reach me: Telegram or Email

bonbast's People

Contributors

ahbanavi avatar alirezaazadi avatar dozheiny avatar moallemi avatar parsampsh avatar samadipour avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bonbast's Issues

Token is expired

Hey

I guess we have an issue:

~/Desktop โฏ bonbast
Error: token is expired. Try again later.

Homebrew method

Hey

Thanks for your great tool!
I always wanted to create a formula in homebrew, so I'll try to create one for this great project!

I'll link my PR to this issue when it's ready

I've got an error while installing

I wanted to install it and my OS is Ubuntu 18.04 and here's the error :

Collecting bs4
Using cached bs4-0.0.1.tar.gz (1.1 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

ร— python setup.py egg_info did not run successfully.
โ”‚ exit code: 1
โ•ฐโ”€> [20 lines of output]
Traceback (most recent call last):
File "", line 2, in
File "", line 14, in
File "/usr/lib/python3/dist-packages/setuptools/init.py", line 12, in
import setuptools.version
File "/usr/lib/python3/dist-packages/setuptools/version.py", line 1, in
import pkg_resources
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 77, in
import('pkg_resources.extern.packaging.requirements')
File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/packaging/requirements.py", line 9, in
from pkg_resources.extern.pyparsing import stringStart, stringEnd, originalTextFor, ParseException
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 672, in _load_unlocked
File "", line 632, in _load_backward_compatible
File "/usr/lib/python3/dist-packages/pkg_resources/extern/init.py", line 43, in load_module
import(extant)
File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/pyparsing.py", line 943, in
collections.MutableMapping.register(ParseResults)
AttributeError: module 'collections' has no attribute 'MutableMapping'
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

ร— Encountered error while generating package metadata.
โ•ฐโ”€> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

403 Client Error: Forbidden for url: https://bonbast.com/

I'm using a github action cronjob to get prices every 15 minutes.
I'm using this piece of code to get the prices:

import bonbast.main

collections = bonbast.main.get_prices()
prices = []
for collection in collections:
    for model in collection:
        try:
            prices.append([model.code, model.sell])
        except AttributeError:
            prices.append([model.code, model.price])
print(prices)

it works well on my machine. But on github actions, sometime it works fine and sometimes i get the error 403 Client Error: Forbidden for url: https://bonbast.com/.

I guess bonbast server blocks the requests sometimes. the reason migh be due to USER_AGENT definition:
USER_AGENT = ('Mozilla/5.0 (Linux; Android 13; SM-G981B) AppleWebKit/537.36 (KHTML, like Gecko) ' 'Chrome/120.0.0.0 Mobile Safari/537.36')

Do you think setting up a random USER_AGENT might fix the issue? something like this:

import requests
import random

user_agents_list = [
    'Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
    'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.83 Safari/537.36',
    'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36'
]

r = requests.get('https://bonbast.com/`, headers={'User-Agent': random.choice(user_agents_list)})

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.