DEV Community

Discussion on: This Post Has 2,451 Views, 168 Reactions And 26 Comments

Collapse
 
mnlwldr profile image
manuel • Edited

Hi Robert, funny idea.
I made this with my Twitter name (Manuel and the x followers) => @mnlwldr and a cronjob that run the code below every minute :)

package main

import (
    "github.com/ChimeraCoder/anaconda"
    "net/url"
    "strconv"
)

func initAnaconda() *anaconda.TwitterApi {
    return anaconda.NewTwitterApiWithCredentials(
        "ACCESS_TOKEN",
        "ACCESS_TOKEN_SECRET",
        "CONSUMER_KEY",
        "CONSUMER_SECRET")
}

func main() {
    api := initAnaconda()
    params := url.Values{}
    me, err := api.GetSelf(params)
    if err != nil {
        panic(err)
    }
    followers := me.FollowersCount
    name := "YOUR_NAME and the " + strconv.FormatInt(int64(followers), 10) + " followers"
    updateParams := url.Values{}
    updateParams.Set("name", name)
    api.PostAccountUpdateProfile(updateParams)
}
Collapse
 
wobsoriano profile image
Robert

Haha looks cool!