Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Open sidebar
Tiger Ton
URHot
Commits
15c7fc9b
Commit
15c7fc9b
authored
2 years ago
by
Tiger Ton
Browse files
Options
Download
Email Patches
Plain Diff
处理 keyword 中的空格
parent
d5ef500d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/cn/urstudio/cn/urhot/controller/PublicController.java
+4
-2
...ava/cn/urstudio/cn/urhot/controller/PublicController.java
with
4 additions
and
2 deletions
+4
-2
src/main/java/cn/urstudio/cn/urhot/controller/PublicController.java
+
4
-
2
View file @
15c7fc9b
package
cn.urstudio.cn.urhot.controller
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.net.URLEncodeUtil
;
import
cn.hutool.core.util.ArrayUtil
;
import
cn.hutool.json.JSONArray
;
import
cn.hutool.json.JSONUtil
;
...
...
@@ -49,7 +50,7 @@ public class PublicController {
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
twitterKeywordsArray
.
size
();
i
++)
{
//获取twitter关键词
String
twitterKeyword
=
twitterKeywordsArray
.
getJSONObject
(
i
).
getStr
(
"name"
);
String
twitterKeyword
=
URLEncodeUtil
.
encode
(
twitterKeywordsArray
.
getJSONObject
(
i
).
getStr
(
"name"
)
)
;
String
url
=
rssHubUrl
+
"/twitter/keyword/"
+
twitterKeyword
+
"?readable=true&authorNameBold=true&widthOfPics=50&heightOfPics=50&limit=100"
;
try
{
Map
<
String
,
Object
>
resultData
=
RssUtils
.
load
(
url
,
cacheEnable
,
cachePath
,
"twitter_keyword"
,
twitterKeyword
);
...
...
@@ -107,7 +108,8 @@ public class PublicController {
String
url
=
""
;
switch
(
type
)
{
case
"twitter_keyword"
:
url
=
rssHubUrl
+
"/twitter/keyword/"
+
name
+
"?readable=true&authorNameBold=true&widthOfPics=50&heightOfPics=50&limit=100"
;
url
=
rssHubUrl
+
"/twitter/keyword/"
+
URLEncodeUtil
.
encode
(
name
)
+
"?readable=true&authorNameBold=true&widthOfPics=50&heightOfPics=50&limit=100"
;
break
;
case
"twitter_user"
:
url
=
rssHubUrl
+
"/twitter/user/"
+
name
+
"?readable=true&authorNameBold=true&widthOfPics=50&heightOfPics=50&limit=100&excludeReplies=true&includeRts=false"
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment