Skip to content

Commit

Permalink
0.9.4 weather fixed + sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
jolav committed Dec 2, 2024
1 parent aa2d5bb commit a3e7d29
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 349 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ _data/
_private.js
_private.json
a_private.go
banned.list
banned*.list
codetabsData.db3
*.db*
*.db3*
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

![Version](https://img.shields.io/badge/version-0.9.3-orange.svg)
![Version](https://img.shields.io/badge/version-0.9.4-orange.svg)
![Maintained YES](https://img.shields.io/badge/Maintained%3F-yes-green.svg)
![Ask Me Anything !](https://img.shields.io/badge/Ask%20me-anything-1abc9c.svg)

# ![logo](https://github.com/jolav/codetabs/blob/master/www/_public/icons/ct/ct64r.png?raw=true) **ONLINE TOOLS ([codetabs.com](https://codetabs.com))**

**version 0.9.3**
**version 0.9.4**

1. [Count LOC (lines of code) online from github/gitlab repos or zipped uploaded folder](#count-loc-online)
2. [CORS proxy](#cors-proxy)
Expand Down
7 changes: 1 addition & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ import (
"github.com/jolav/codetabs/random"
"github.com/jolav/codetabs/stars"
"github.com/jolav/codetabs/store"

//"github.com/jolav/codetabs/video2gif"
"github.com/jolav/codetabs/weather"
)

var version = "0.9.3"
var version = "0.9.4"
var when = "undefined"

type Conf struct {
Expand Down Expand Up @@ -89,15 +87,13 @@ func main() {

go alexa.OnceADayTask()
index := loc.NewIndex(false)
//index2 := video2gif.NewIndex(false)

mux := http.NewServeMux()

mux.HandleFunc("/v1/alexa/", mw(alexa.Router, "alexa", c))
mux.HandleFunc("/v1/geolocation/", mw(geolocation.Router, "geoip", c))
mux.HandleFunc("/v1/headers/", mw(headers.Router, "headers", c))
mux.HandleFunc("/v1/weather/", mw(weather.Router, "weather", c))
//mux.HandleFunc("/v1/video2gif/", mw(index2.Router, "video2gif", c))
mux.HandleFunc("/v1/random/", mw(random.Router, "random", c))
mux.HandleFunc("/v1/stars/", mw(stars.Router, "stars", c))
mux.HandleFunc("/v1/proxy/", mw(proxy.Router, "proxy", c))
Expand Down Expand Up @@ -200,7 +196,6 @@ func FAKE__getGlobalConfigJSON() (configjson []byte) {
"loc",
"proxy",
"stars",
"video2gif",
"weather"
]
}
Expand Down
284 changes: 0 additions & 284 deletions video2gif/video2gif.go

This file was deleted.

6 changes: 4 additions & 2 deletions weather/weather.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (wt *weather) getWeather(w http.ResponseWriter) {
} else if source == 3 {
url = "https://api.weatherapi.com/v1/current.json"
url += "?key=" + WEATHERAPI_KEY
url += "&q=" + wt.Out.City + "&aqui=no"
url += "&q=" + wt.Out.City + "&aqi=no"
}
resp, err := http.Get(url)
if err != nil {
Expand Down Expand Up @@ -163,7 +163,9 @@ type geoData struct {

func (wt *weather) getGeo(w http.ResponseWriter, r *http.Request) {
var geo = geoData{}
url := "https://api.codetabs.com/v1/geolocation/json?q=" + u.GetIP(r)
//url := "https://api.codetabs.com/v1/geolocation/json?q=" + u.GetIP(r)
url := AUX_URL + u.GetIP(r)

resp, err := http.Get(url)
if err != nil {
msg := fmt.Sprint("ERROR requesting GetGeo URL")
Expand Down
Loading

0 comments on commit a3e7d29

Please sign in to comment.