昨天,今天,明天,每天的每天,你是否都多懂得一点点...

星期六, 二月 22, 2020

Wordpress too many redirects wp_admin 和 mixed content 的问题解析

Wordpress 架设在反向代理 reserve-proxy 后面而且使用HTTPS的时候, 常常会碰到这两个问题。 一个是进入后台登录页面的时候出现 too many redirects, 造成无法登录。 而另一个则是在前台CSS也显示不正确, 因为有 mixed content. 

其实在两年前我就碰到过这样的问题, 只是当时谷歌搜索解决了一下问题, 对问题如何引起的并没有关注。 以下是两年前发的贴子。


我今天帮朋友架设一个新的wordpress 网站的时候, 又碰到了这个同样的问题, 可悲的是, 我对自己以前如何解决这个问题完全没有记忆, 甚至没有找到上面这个帖子。 又折腾了大半天。 

所以今天就来好好的分析一下问题的所在, 完全理解了就不容易忘记。 

首先这两个问题都只发生在有反向代理, 而且反向代理使用HTTPS, 而wordpress 本身不使用HTTPS的情况。 

浏览器->反向代理(HTTPS)-> WordPress (HTTP).

我使用的反向代理是 Nginx-Proxy docker 版。

由于HTTP是不安全的协议, 而 wordpress 是有后台可以登录的, 所以我们一定要给 wordpress 启用HTTPS。 而最简单的办法莫过于用反向代理。 我们在服务器上运行两个服务, 一个是反向代理, 一个是WORDPRESS。 反向代理通常监听 80 和 443 两个端口, 而 wordpress 则监听一个内部端口, 如 8080. 

我这里在后台设置的网址是HTTP的, 这里涉及到 HTTP Strict Transport Security (HSTS) 的问题, 这东西常常把问题搞得更加复杂难懂, 我呆会儿会讲到。



当我们的浏览器访问网站的时候, 其实请求是发送到反向代理上的, 这里可以使用 HTTP, 也可以使用 HTTPS. 然后, 反向代理收到请求后, 会把这个请求转发给 8080 端口, 这样, 请求就到了 Wordpress 上。 Wordpress再把内容回复给反向代理, 反向代理再回复给浏览器。 由于 wordpress 是运行在 内部的8080 端口上的是, 所以即使它用的是HTTP协议, 却也是安全的。 


以上这种设置在跑HTTP的时候不会有问题。 但是, 跑HTTPS的时候, 问题就来了。 因为虽然我们浏览器发的HTTPS的请求, 但是反向代理发到Wordpress 的请求确是一个HTTP的请求。 这个时候, Wordpress 并不知道反向代理的存在, 所以它以为有一个用户在通过HTTP请求页面, 这时候 Wordpress 生成的网页里的CSS和Javascript 文件链接就全是HTTP的,而不是HTTPS的。 这个时候, 就会有 Mixed content 的问题。 因为我们请求的主页是HTTPS的, 但主页里的链接却全是 HTTP的。 

以上就是为什么会有Mix Content 的问题。 


理解了上面的情况, 再来理解 Too many redirects 也很容易了。 因为原因是一样的。 因为HTTP是不安全的, 所以我们在登录后台的时候就需要使用HTTPS, 这里有两种方法, 第一种, 把wordpress 设置里面的网址强制成 HTTPS开头的。 第二种, 在wordpress 的配置文件 wp-config.php 中加入以下这行

define('FORCE_SSL_ADMIN', true);

这样, 再登录后面的时候, 我们就可以保证在HTTPS下运行了。 因为当你是HTTP的请求进来的时候, Wordpress 会返回一个重定向的回复, 把请求引到HTTPS上。 

但是, 如果你还记得上面我说的, 这个时候就有个大问题。 其实我们浏览器到服务器的请求本来就已经是HTTPS了, 这个时候, 是反向代理收到了请求, 然后反向代理转发请求到Wordpress 端口的时候用的却是HTTP, 于是Wordpress 返回重定向的网址, 要求浏览器重定向到HTTPS。 于是浏览器被重定向到了一个相同的地址, 可是反向代理又把HTTPS转成HTTP了, Wordpress 又要求重定向, 于是就出现了死循环。 这就是为什么会有 too many redirects 的原因。 


以上还不是最糟糕的,因为你会发现,一旦你设置的网址是HTTPS开头的, 不仅HTTPS不工作, 这时候连HTTP也不工作了。 所以你无论如何都登录不了后台, 也无法把网址改回来。因为你用HTTP访问的时候, Wordpress 会把你重定向到HTTPS.

于是你只好千方百计的去数据库把网址改成HTTP, 比如说用 phpmyadmin. 

可是你悲剧的发现,这并没有用, 你还是一直被重定向到HTTPS, 可是你明明已经改了数据库里的网址呀? 这就涉及到了 HSTS. 

默认情况下, nginx-proxy 的HSTS是开启的,所以一但你用了HTTPS登录过网站后, 你再用HTTP登录的时候, 浏览器会自动把HTTP转成HTTPS. 这个时候唯一的方法就是进入浏览器的设置把你网址的HSTS记录删除。 否则你永远也无法使用HTTP来访问网站。 当然, 有时候你可以使用一个新的没有登录过HTTPS 浏览器或隐身模式来开网站。 

使用 phpmyadmin 改为网址再清了HSTS后,你就可以用HTTP 访问网站了。 但是这绕了一圈又回到原点, 并没有解决HTTP 登录后台不安全的问题。 所以, 后面才是真正的解决方案。 


首先, 我们在后台设置的网址应该用 HTTP,而不是HTTPS。 

是否强制使用HTTPS, 我们可以通过设置反向代理来做到, 比如 Nginx-proxy 可以通过 HTTPS_METHOD 这个变量来决定是否强制HTTP或HTTPS, 或两者都可以。 而我是设置了两者都可以。 


如果设置了两者都可以, 我们如何保证用HTTPS后台登录呢? 这时候,我们可以在 wp-config.php 里加入以下这行

define('FORCE_SSL_ADMIN', true);


这样会强制在登录后台的时候会转到HTTPS, 不登录后台的话, 则HTTP或HTTPS都可以。

然后就是最重要的一步, 

你要在wp-config.php 里面加入以下代码来识别浏览器的原协议是否HTTPS。 

// If we're behind a proxy server and using HTTPS, we need to alert Wordpress of that fact
// see also http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
        $_SERVER['HTTPS'] = 'on';
}

或者你也可以试试官方给出的代码, 效果应该一样。

if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
$_SERVER['HTTPS']='on';

这段代理假设你的反向代理有插入 X_FORWARDED 头, 至少 nginx-proxy 是有的。 如果你的反向代理没有, 你应该可以将这个功能打开。 如果不行, 建议你换个反向代理工具。 

好了, 以上就是烦人的 HTTP Wordpress behind HTTPS reverse proxy 的问题的解决方案。 顺便提一下, 这种情况不要去安装 Wordpress 的HTTPS /SSL 插件, 它们并没有用。



星期四, 二月 20, 2020

[youtube]口罩用途全解析, 哪种最适合冠状病毒? 外科? 医用? N95? P2? R95?

tags: 口罩, 冠状, 病毒, n95, r95, n95, p2



由于冠状病毒的传播, 口罩变得炙手可热. 但是市面上的口罩多种多样, 到底哪一种才是最适合的呢? 如果你手上没有最适合的那种, 其它口罩可以代替吗? 

视频中介绍的都是有通过标准认证的口罩. 那些没有任何认证的绵布口罩或其它口罩通常不能有效阻止微小的病毒的载体颗粒. 把绵布口罩洗了再用这种省钱的方式是不可取的.

--
Feng

星期六, 二月 15, 2020

[Youtube]峰哥教你玩正则表达式 - 第六课 - 正则原理与前瞻后瞻

Tags: regex, regular expression, regex101, 正则, 正则表达式, 前瞻, 后瞻

本节课为正则表达式高级教程, 看完本视频你将掌握:

正则表达式的大概原理 (有限状态机)
正则表达式中的肯定前瞻
 正则表达式中的否定前瞻 
正则表达式中的肯定后瞻 
正则表达式中的否定后瞻   


-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 同时我也会分享一些编程的教程, 如编写Telegram机器人, 建站等。 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz
🔷 Twitter: https://twitter.com/fennng

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-



星期四, 二月 13, 2020

How to batch run npm install on Windows 10

If for some reasons, npm update doesn't fit you need and you need to update some npm packages one by one.

You will want to write a batch command to do it. It seems that a simple bat or cmd file with all the npm installl command listed will work. 

But the truth on windows is, only the first command is run.  

The reason is that npm itself is not a command but a batch file too. Too make sure all the npm commands will be run, you can add a call in the front of the command. 

Check the example below:


call npm install @angular/core@latest
call npm install @angular/forms@latest
call npm install @angular/platform-browser@latest
call npm install @angular/platform-browser-dynamic@latest
call npm install @angular/platform-server@latest
call npm install @angular/router@latest
call npm install @angular/tsc-wrapped@latest
call npm install @angular/core@latest
call npm install angular2-notifications@latest
call npm install bootstrap@latest
call npm install codelyzer@latest
call npm install elements-zone-strategy@latest
call npm install extract-text-webpack-plugin@latest
call npm install html-webpack-plugin@latest
call npm install karma-webpack@latest
call npm install webpack-dev-middleware@latest
call npm install ng-pick-datetime@latest
call npm install ng2-img-max@latest
call npm install ngx-file-drop@latest
call npm install ngx-mask@latest
call npm install tsickle@latest

--
Feng

星期日, 二月 09, 2020

[Youtube]峰哥教你玩正则表达式 - 第五课 - 分组与优先级

Tags: regex, regular expression, regex101, 正则, 正则表达式, 分组, group

本节课为正则表达式入门教程, 看完本视频你将掌握:

正则表达式中如何定义匹配的优先级
如何抓取分组里的内容
如何使用抓取的内容替换


-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 同时我也会分享一些编程的教程, 如编写Telegram机器人, 建站等。 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz
🔷 Twitter: https://twitter.com/fennng

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-




星期二, 一月 21, 2020

A strange but works connection using HG259B as a wifi repeater

The connection is a little bit wield. The other router doesn't need any config. 

HG259B is router B
The original router is router A

Router B is from previous internet company. Router A is from the new  internet company. 

The original layout is simple, router A is connected to the fibre box with the WAN port. All other devices can connect to internet through router A's WIFI.

Telephone is connected to router A and working. 

Both routers have 2 telephone ports. But only router A has correct VOIP settings. Router A's company doesn't provide password to login to router A. So there is no way to copy the VOIP settings. 

The problem is that router A's WIFI signal cannot reach as Far as router B. Router B has the same config as router A for internet connection, so use router B for internet connection is OK. but as router B doesn't have VOIP settings,  telephone is not working with router B.

As we cannot enter router A's management portal, we can only do something from router B. The bad news is that Router B doesn't support WDS, so cannot use as a standard WIFI repeater.

The solution I made here is still using router B as a wifi repeater. 


The connection is as such:

Router B's WAN port connects to Fibre box
Router A's WAN port connects to Router B's LAN 1
Router A's LAN 2 connects to Router B's LAN 2


The hardware connection is simple, but wield. As Router A and Router B is already connected using  WAN port and LAN 1, it shouldn't need LAN2 to LAN2 connection. 


The software part is more complex:

1. Router B needs to be config as bridge mode, as below



2. Router B's IP is config to match Router A's domain, in my case, Router A's IP is 192.168.20.1, so I set router B's IP to 192.168.20.254. Also DHCP should be turned off. (So that Router'A DHCP will work).




3. Telephone is still connect to Router A


With this settings, Connect to both Router A's WIFI and Router B's WIFI will work. 

Different from WDS, their WIFI name and password are different. But actually they are the same network. Devices connect to both WIFI and talk to each other.



Questions: If we don't use bridge mode, can we still make it work? I failed once with these settings. But I am not sure If I made some other mistakes. It suppose to work with the following connection:

Router A's WAN port connect to Fibre box
Router B's LAN 1 connect to Router A's LAN 1
Router B change IP to match router A
Router B disable DHCP




--
Feng

星期五, 一月 17, 2020

Re: How to use a different nodejs version on atlassian bamboo build agent

If docker is available on the build server, use docker contained nodejs to build is a good idea too.

feng <fengnz@gmail.com> 于2020年1月17日周五 上午10:40写道:
When you build a nodejs app, you may need to use a specific version of node for building.  Either you want to match the running env or your node packages require a certain nodejs version. 

On Azure DevOps, you can easily choose the node version by adding a nodejs installer step. With bamboo, there is no nodejs install, but this can be achieved easily if you have admin access to the build agent. 

In the build steps, add a script step, and add the following inline script. This script will switch the node version for you. For first time running, you need to uncomment all the lines to install nvm first. 

[bash]

node -v
#curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
#nvm install 13.6.0
nvm use 13.6.0
nvm list
node -v
[/bash]

Then you can add a npm install step, it will use the new node version. Or you can simply add node install command to the script.

--
Feng


--
Feng

How to use a different nodejs version on atlassian bamboo build agent

When you build a nodejs app, you may need to use a specific version of node for building.  Either you want to match the running env or your node packages require a certain nodejs version. 

On Azure DevOps, you can easily choose the node version by adding a nodejs installer step. With bamboo, there is no nodejs install, but this can be achieved easily if you have admin access to the build agent. 

In the build steps, add a script step, and add the following inline script. This script will switch the node version for you. For first time running, you need to uncomment all the lines to install nvm first. 

[bash]

node -v
#curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
#nvm install 13.6.0
nvm use 13.6.0
nvm list
node -v
[/bash]

Then you can add a npm install step, it will use the new node version. Or you can simply add node install command to the script.

--
Feng

星期四, 一月 09, 2020

[Youtube]峰哥教你玩正则表达式 - 第四课 - 或的关系和与(且)的关系及其原理(肯定前瞻)


Tags: regex, regular expression, regex101, 正则, 正则表达式, 前瞻, look ahead

本节课为正则表达式入门教程, 看完本视频你将掌握:

如何写"或"关系的正则
如何写"与"关系的正则
"与"关系是什么原理


视频中2分40多秒的时候, 有个口误 , 或关系的字符是竖线字符, 视频中讲成下划线字符.



 
-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 同时我也会分享一些编程的教程, 如编写Telegram机器人, 建站等。 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz
🔷 Twitter: https://twitter.com/fennng

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-



星期一, 十二月 30, 2019

[Youtube]峰哥教你玩正则表达式 - 第三课 - 重复符号 *, ?, + , 贪婪模式, 懒惰模式, 侵占模式



Tags: regex, regular expression, regex101, 正则, 正则表达式, 贪婪模式, 懒惰模式, 侵占模式


本节课为正则表达式入门教程, 看完本视频你将掌握:


使用特殊重复字符 *, ?, +, {}
使用贪婪模式
使用懒惰模式
使用侵占模式



 
-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 同时我也会分享一些编程的教程, 如编写Telegram机器人, 建站等。 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz
🔷 Twitter: https://twitter.com/fennng

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-




星期一, 十二月 23, 2019

[Youtube]峰哥教你玩正则表达式 - 第二课 - 特殊匹配符号



Tags: regex, regular expression, regex101, 正则, 正则表达式


本节课为正则表达式入门教程, 看完本视频你将掌握:


使用特殊元字符 \d \D \b \B \w \W \s \S ^ $, 
用 [] 组建匹配字符集
用^ 制作字符的反集
匹配完整单词
匹配数字
匹配非数字
匹配英文字符
匹配非英文字符




 
-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 同时我也会分享一些编程的教程, 如编写Telegram机器人, 建站等。 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz
🔷 Twitter: https://twitter.com/fennng

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-



星期四, 十二月 19, 2019

[网络技术]How to list all remote docker images in the repo?

tags: docker

If you have a private docker repo (such as azure docker registry), and would like to list all the remote images, what would you do?

If you have the portal access such as azure portal, you can see all your images easily. But if you only have the credentials for the repo, then what can you do?

It's actual very easy to do.

Docker registry provides a easy to use restful API to access images info. You can use any HTTP client to access it. In the following example, I use curl 

[code]

curl https://username:password@repo_domain/v2/_catalog  

{"repositories": ["image1", "image2", "image3" ...]}

[/code]


星期日, 十二月 08, 2019

[Youtube]如何验证, 调试正则表达式, 在线工具使用教程, 无需下载

Tags: regex, regular expression, regex101, 正则, 正则表达式

超级好用的在线正则表达式工具

本视频是此工具的使用教程

 
-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 同时我也会分享一些编程的教程, 如编写Telegram机器人, 建站等。 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz
🔷 Twitter: https://twitter.com/fennng

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-


[Youtube]Windows (多种版本适用) 定时关机小技巧, 无需下载



Tags: windows, 定时, 关机, 重启

本方法支持 从 windows xp 到 windows 10 的所有windows 系统.

 
-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 同时我也会分享一些编程的教程, 如编写Telegram机器人, 建站等。 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz
🔷 Twitter: https://twitter.com/fennng

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-

星期日, 十一月 24, 2019

[Youtube][跟峰哥学Node.js编程系列教程] Javascript Promise 异步编程全解析 [第十二期]

Tags: Javascript, nodejs, 峰哥, yufeng deng, expressjs, jade, pug, handlebars, bootstrap, Telegram Bot, Promise

本集对javascript 中的 promise 作一个详细的解析. Promise 是在javascript 中的一个异步操作, 也就是可以同时进行多个任务, 而不需要等待.  看完本集你将学会.

如何使用Promise函数
如何处理Promise函数返回的结果
如何使用 Promise 中的 catch 和 Promise.reject
如何链接多个 Promise.then
如何把前一个then的处理结果传给下一个then
如何嵌套多个 Promise 函数(实现同步操作)
如何等待多个Promise 的结果返回, 使用 Promise.all


之前的教程可以在这个播放列表找到

视频里用到的代码请到

 
-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 同时我也会分享一些编程的教程, 如编写Telegram机器人, 建站等。 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz
🔷 Twitter: https://twitter.com/fennng

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-



星期日, 十一月 17, 2019

[Youtube]太牛了! Kubesail, 可以一键布署的免费服务器! 居然是免费的!

Tags: Javascript, nodejs, 峰哥, yufeng deng, expressjs, jade, pug, handlebars, bootstrap, Telegram Bot, kubesail, 免费, 服务器, 容器, kubernetes


Nodejs 网站+Telegram 机器人后台程序布署示例.


本集介绍如何使用Kubesail 将你的服务程序一键部署到远程服务器上.

本集将介绍如下内容 

注册github
注册docker hub
注册kubesail
安装docker 
安装npx 
一键部署nodejs 程序到kubesail
绑定程序端口到公开域名上


Nodejs编程系列的教程可以在这个播放列表找到
https://www.youtube.com/playlist?list=PL3dZh-p-vVofgTEnJ_SL1LM9jxmQp19E2

 
-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 同时我也会分享一些编程的教程, 如编写Telegram机器人, 建站等。 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz
🔷 Twitter: https://twitter.com/fennng

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-


星期日, 十一月 10, 2019

[Youtube][跟峰哥学Node.js编程系列教程] 制作Telegram聊天聊软 回声机器人 [第十一期]

Tags: Javascript, nodejs, 峰哥, yufeng deng, expressjs, jade, pug, handlebars, bootstrap, Telegram Bot


本集介绍如何使用之前学的内容做一个简单的telegram 回声机器人. 在这个机器人的基本上, 小伙伴们可以开发出属于自己的强大聊天机器人. 看完本集你将学会.

如何绑定Telegram机器人到你的代码上
如何接收聊天群里发来的请求
如何读取聊天群的ID和发来的消息
如何把重复的代码变成一个函数
如何使用你的代码发送机器人消息
如何读取发送机器人消息后, TG返回的数据


之前的教程可以在这个播放列表找到
https://www.youtube.com/playlist?list=PL3dZh-p-vVofgTEnJ_SL1LM9jxmQp19E2


视频里用到的代码请到

 
-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 同时我也会分享一些编程的教程, 如编写Telegram机器人, 建站等。 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz
🔷 Twitter: https://twitter.com/fennng

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-




星期日, 十一月 03, 2019

[Youtube][跟峰哥学Node.js编程系列教程] 调用第三方API - Telegram 机器人示例 [第十期]

Tags: Javascript, nodejs, 峰哥, yufeng deng, expressjs, jade, pug, handlebars, bootstrap, Telegram Bot


本集介绍如何使用 node fetch 调用第三方 Restful API. 本集使用 Telegram 机器人的API作为示例.  在本集视频的视频中, 将介绍如何调用Telegram 机器人的API, 把用户在网页上输入的内容转发到TG的群组当中. 


之前的教程可以在这个播放列表找到
https://www.youtube.com/playlist?list=PL3dZh-p-vVofgTEnJ_SL1LM9jxmQp19E2


视频里用到的代码请到

 
-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 同时我也会分享一些编程的教程, 如编写Telegram机器人, 建站等。 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz
🔷 Twitter: https://twitter.com/fennng

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-



星期日, 十月 20, 2019

[Youtube][跟峰哥学Node.js编程系列教程] 制作简单的URL转码在线工具 [第九期]

Tags: Javascript, nodejs, 峰哥, yufeng deng, expressjs, jade, pug, handlebars, bootstrap, Url Encoder


本集是节实验课, 演示一下使用之前学习的内容, 如何做出一个在线URL转码的小工具! 



之前的教程可以在这个播放列表找到
https://www.youtube.com/playlist?list=PL3dZh-p-vVofgTEnJ_SL1LM9jxmQp19E2


视频里用到的代码请到

 
-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 同时我也会分享一些编程的教程, 如编写Telegram机器人, 建站等。 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz
🔷 Twitter: https://twitter.com/fennng

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-


其它博客地址

此博客的同步博客地址: http://fengnz.wordpress.com
点这里进入我的MSN SPACE.