Giter Site home page Giter Site logo
  • šŸ‘‹ Hi, Iā€™m @XurshidbekDavronov
  • šŸ‘€ Iā€™m interested in IT
  • šŸŒ± Iā€™m currently learning
  • šŸ’žļø Iā€™m looking to collaborate on ...
  • šŸ“« How to reach me ...

Xurshidbek Davronov's Projects

obhavo icon obhavo

import requests import telebot import json token='726606764:AAGvL69oWVlNZrv9uknwrQh2EuncSIT-ysg' bot=telebot.TeleBot(token) @bot.message_handler(commands=['start']) def start(message): bot.send_message(message.chat.id, '@vahimachi_bot ga hush kelibsiz. Shahar nomini kiriting.(Faqat inglizchada)') @bot.message_handler(content_types=['text']) def weather(message): api_url='https://api.openweathermap.org/data/2.5/weather' city=message.text r=requests.post(url=api_url, params={'q':city, 'APPID':'35897244bed48a9ea34419924a355e3e', 'units':'metric'}) if r.status_code==200: response=json.loads(r.content) temp=str(response['main']['temp']) max_temp=str(response['main']['temp_max']) min_temp=str(response['main']['temp_min']) wind_speed=str(response['wind']['speed']) pressure=str(response['main']['pressure']) humidity=str(response['main']['humidity']) msg='Hozirgi vaqtda siz so`ragan shaharda' ' ' +temp+'daraja '+'\n'+'Yuqori temperatura '+max_temp+' daraja'+'\n'+' Past temperatura'+min_temp+' daraja'+'\n'+wind_speed+'\n'+pressure+'\n'+humidity+'\n' bot.send_message(message.chat.id, msg) else: bot.send_message(message.chat.id, 'Og`ayni xato diyaptiku. Boshqa kiritib ko`ringchi') bot.polling(none_stop=True)

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.