Git Product home page Git Product logo

daily-warm's Introduction

Daily-warm

每天定时发邮件给你关心的人, 内容包含天气, one 的一句话, 一句英语, 一首古诗

Usage

# 1. Config `.env` file in root dir, e.g.
MAIL_USERNAME = [email protected]
MAIL_PASSWORD = ***********
MAIL_HOST = smtp.qq.com
MAIL_PORT = 25
# 每分钟发一次
MAIL_CRON = "0/1 * * * *"
MAIL_SUBJECT = 每日一暖, 温情一生
MAIL_FROM = user<[email protected]>
MAIL_TO = [{"email": "user<[email protected]>", "local": "shaanxi/xian"}]

# 2.Build
go mod download
go build -o dwm.out *.go

# 3. Run
./dwm.out

Screenshot

Package

github.com/barryyan/daily-warm/gomail

// import "github.com/barryyan/daily-warm/gomail"
package gomail 

type Configuration struct{
  Host     string
  Port     uint16
  Username string
  Password string
  From     string
}
var Config = Configuration{}

type GoMail struct{
  From    string
  To      []string
  Cc      []string
  Bcc     []string
  Subject string
  Content string
}
func (gm *GoMail) Send() error {}

github.com/barryyan/daily-warm/api

// import "github.com/barryyan/daily-warm/api"
package api 

func CreateClient() *http.Client
func Fetch(url string) io.Reader
func FetchHTML(url string) *query.Document
type English struct{
  ImgURL   string
  Sentence string
}
func GetEnglish() English
type One struct{
  Date     string
  ImgURL   string
  Sentence string
}
func GetONE() One
type Poem struct{
  Title   string   `json:"title"`
  Dynasty string   `json:"dynasty"`
  Author  string   `json:"author"`
  Content []string `json:"content"`
}
func GetPoem() Poem
type PoemRes struct{
  Status string `json:"status"`
  Data   struct {
    Origin Poem `json:"origin"`
  } `json:"data"`
}
type Weather struct{
  City     string
  Temp     string
  Weather  string
  Air      string
  Humidity string
  Wind     string
  Limit    string
  Note     string
}
func GetWeather(local string) Weather

daily-warm's People

Watchers

 avatar

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.