Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PS07 example code won't work #65

Open
ghost opened this issue Sep 20, 2022 · 1 comment
Open

PS07 example code won't work #65

ghost opened this issue Sep 20, 2022 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 20, 2022

Hello.

I followed simple example code on your website :
https://pypi.org/project/Marine-Traffic-API/

class AISWorker(QThread):
    ui_text_signal = pyqtSignal(str, str)
    ui_color_signal = pyqtSignal(str, str)

    def __init__(self):
        super().__init__()
        self.api = MarineTrafficApi(api_key="deleted for privacy reason")
        # time_span = The maximum age, in minutes, of the returned positions.
        # Maximum value for terrestrial coverage is 60.
        # Maximum value for satellite coverage is 180.
        self.vessel = self.api.single_vessel_positions(time_span=20, mmsi=441577000)
        # Mega Trust mmsi = 441577000
        MarineTrafficApi.print_params_for('single_vessel_positions')
        self.vessel = self.vessel.models[0]
        self.alive = True

I executed this code and get this result :

self.vessel = self.vessel.models[0]
IndexError: list index out of range

@ghost
Copy link
Author

ghost commented Sep 20, 2022

my key is for single vessel positions. I can check my profile on marine traffic website and api key is still valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants