Giter VIP home page Giter VIP logo

fb-auto-reporter's People

Contributors

mohoazure avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fb-auto-reporter's Issues

Save heroku dyno quota

For now, a free worker dyno is used by this app, and it cannot provide service through out a month once the free quota is consumed.

[Ref] https://devcenter.heroku.com/articles/free-dyno-hours#dyno-sleeping
A heroku worker would sleep if the dyno receives no web traffic in a 30-minute period.
Apps that only utilise a free worker dyno do not sleep, because they do not respond to web requests.
Free web dynos do not consume free dyno hours while sleeping.

Possible solution: heroku clock
https://devcenter.heroku.com/articles/clock-processes-python

Refactoring

  • separate api tokens, keys, pw from config.py
  • rename config.py to config_reporter.py
  • update examples accordingly
  • move config files to "conf" folder
  • move collectors of news, weather and pic to 'collector' folder
  • move log to 'log' folder

the morning news report is empty

No news is reported, only pre-defined messages.

This may not be a problem since the pages really have no posts at 00:00~0700.

Features of bot

Periodical Report

report weather

  • locations: Taipei and Tainan
  • weather info: temperature, wind, etc.
  • report time:
    • current weather at 0700, 1200, 1700
    • report forecast at 2200

report news

  • collects news of fb pages (group and fan pages)
  • report time: 0700, 1200, 1700, 2200
  • news info:
    • short description, time of post, url
    • classify news by types
  • a 0700 news reports posts created at 2200 ~ 0700
  • a 1200 news reports posts created at 0700 ~1200
  • a 1800 news reports posts created at 1200 ~1800
  • a 2200 news reports posts created at 1800 ~ 2200

log bot event

  • the post event (weather, news...)
    • the id of post
    • error message

the morning news reports yesterday's news

fix time checking in fb news collector.

datetime.today().date() returns date of the machine.

For a user residents in a time zone different from the machine, the user may get news create in yesterday.
For example, a machine is in UTC+0, a user is in UTC+8, and a news is created in 2020-11-30 08:00:01 in UTC+8, the date of the news is considered as 'today' by the machine but not by the user.

Feature of bot messenger

Concurrent Report

  • When posting a weather or a page news report, send page admin a copy
  • at least the link to the report since msg length has limitation

On-Demand Report

A User is messaging with the Bot.

Use case: report weather

  1. Bot provides report categories (news, weather, pic)
  2. A User selects weather
  3. Bot reports "current weather"

Use case: report news

  1. Bot provides report categories (news, weather, pic)
  2. A User selects news
  3. Bot provides types of news as listed in config file
  4. A User selects a news type
  5. Bot reports news of that type

Use case: report pic

  1. Bot provides report categories (news, weather, pic)
  2. A User selects pic
  3. Bot reports recommended pic

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.