1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-24 00:45:52 +00:00

Backport a fix from upstream for HTTP code 406 when doing search, and also

stagify the port.

PR:	ports/184981
This commit is contained in:
Alexey Dokuchaev 2014-04-03 11:26:45 +00:00
parent b7bc5996be
commit 0e566caf5d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=350000
2 changed files with 124 additions and 3 deletions

View File

@ -3,6 +3,7 @@
PORTNAME= hotot
PORTVERSION= 0.9.8.14
PORTREVISION= 1
CATEGORIES= net-im www
MAINTAINER= danfe@FreeBSD.org
@ -26,7 +27,6 @@ OPTIONS_DEFINE= GTK2 QT4 KDE4
OPTIONS_DEFAULT= GTK2 QT4
KDE4_DESC= KDE 4 integration (implies Qt 4)
NO_STAGE= yes
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MGTK2}
@ -66,7 +66,5 @@ post-patch:
# Sanitize font selection list
@${REINPLACE_CMD} -e "/font_list/s/\[.*/['DejaVu Sans', 'Bitstream Vera Sans', 'Droid Sans', 'Verdana', 'Arial', 'Helvetica']/" \
${WRKSRC}/data/js/conf.js
# Remove stale backup files (prevent pkg-plist pollution)
@${FIND} ${WRKSRC} -type f -name '*.bak' -delete
.include <bsd.port.mk>

View File

@ -0,0 +1,123 @@
diff --git a/data/index.html b/data/index.html
index 2565030..37f564c 100644
--- data/index.html
+++ data/index.html
@@ -905,11 +905,11 @@ <h3 data-i18n-text="api_setting">API Settings</h3>
<label class="label" data-i18n-text="oauth_base"
>OAuth Base</label>
</li><li class="mochi_list_item">
- <input id="tbox_prefs_search_api_base2"
+ <input id="tbox_prefs_search_api_base3"
title="Search API Base"
type="text" class="mochi_entry widget"/>
<label class="label"
- data-i18n-text="search_api_base2"
+ data-i18n-text="search_api_base3"
>Search API Base</label>
</li><li class="mochi_list_item">
<input id="tbox_prefs_upload_api_base"
diff --git a/data/js/conf.js b/data/js/conf.js
index 559bc03..f251dab 100644
--- data/js/conf.js
+++ data/js/conf.js
@@ -78,6 +78,7 @@ default_prefs: {
, 'sign_oauth_base': 'https://api.twitter.com/oauth/'
, 'use_same_sign_oauth_base': true
, 'search_api_base2': 'https://twitter.com/phoenix_search.phoenix'
+ , 'search_api_base3': 'https://api.twitter.com/1.1/search/tweets.json'
, 'upload_api_base': 'https://upload.twitter.com/1/'
// extensions and others
, 'exts_enabled': ["org.hotot.imagepreview", "org.hotot.gmap", "org.hotot.translate", "org.hotot.imageupload", "org.hotot.videopreview", "org.hotot.shorturl", "org.hotot.cfw"]
@@ -126,7 +127,7 @@ default_prefs: {
, 'oauth_base': 'https://identi.ca/api/oauth/'
, 'sign_oauth_base': 'https://identi.ca/api/oauth/'
, 'use_same_sign_oauth_base': true
- , 'search_api_base2': 'https://identi.ca/api/'
+ , 'search_api_base3': 'https://identi.ca/api/'
, 'upload_api_base': 'https://identi.ca/api/'
// extensions:
, 'exts_enabled': ["org.hotot.imagepreview", "org.hotot.gmap", "org.hotot.translate", "org.hotot.imageupload", "org.hotot.videopreview", "org.hotot.shorturl", "org.hotot.cfw"]
@@ -326,7 +327,7 @@ function apply_prefs(name, full) {
}
})(prefs.api_base);
globals.twitterClient.sign_api_base = prefs.sign_api_base;
- globals.twitterClient.search_api_base2 = prefs.search_api_base2;
+ globals.twitterClient.search_api_base3 = prefs.search_api_base3;
globals.twitterClient.upload_api_base = prefs.upload_api_base;
globals.twitterClient.use_same_sign_api_base = prefs.use_same_sign_api_base;
var oauth = globals.twitterClient.oauth;
diff --git a/data/js/lib.twitter.js b/data/js/lib.twitter.js
index 91ff50f..96da74f 100644
--- data/js/lib.twitter.js
+++ data/js/lib.twitter.js
@@ -10,7 +10,7 @@ function TwitterClient() {
self.password = '';
self.api_base = 'https://api.twitter.com/';
self.sign_api_base = 'https://api.twitter.com/';
- self.search_api_base2 = 'https://twitter.com/phoenix_search.phoenix';
+ self.search_api_base3 = 'https://api.twitter.com/1.1/search/tweets.json';
self.upload_api_base = 'https://upload.twitter.com/1/';
self.use_same_sign_api_base = true;
@@ -764,7 +764,7 @@ function TwitterClient() {
};
self.search = function search(query, page, since_id, max_id, on_success, on_error) {
- var url = self.search_api_base2;
+ var url = self.search_api_base3;
if (url == 'https://twitter.com/phoenix_search.phoenix') {
var params = {
'q': query
@@ -786,9 +786,10 @@ function TwitterClient() {
var params = {
'q': query
};
- if (since_id != null) params['since_id'] = since_id;
+ params['count'] = 100;
+ params['include_entities'] = 'true';
+ params['result_type'] = 'recent';
if (max_id != null) params['max_id'] = max_id;
- if (page != null) params['page'] = page;
self.source = '';
self.get(url, params, on_success, on_error);
self.source = 'Hotot';
diff --git a/data/js/ui.prefs_dlg.js b/data/js/ui.prefs_dlg.js
index 22a8be4..287ae99 100644
--- data/js/ui.prefs_dlg.js
+++ data/js/ui.prefs_dlg.js
@@ -323,7 +323,7 @@ function load_prefs() {
.prop('checked', prefs.enable_gpu_acceleration);
$('#tbox_prefs_api_base').val(prefs.api_base);
$('#tbox_prefs_sign_api_base').val(prefs.sign_api_base);
- $('#tbox_prefs_search_api_base2').val(prefs.search_api_base2);
+ $('#tbox_prefs_search_api_base3').val(prefs.search_api_base3);
$('#tbox_prefs_upload_api_base').val(prefs.upload_api_base);
$('#tbox_prefs_oauth_base').val(prefs.oauth_base);
$('#tbox_prefs_sign_oauth_base').val(prefs.sign_oauth_base);
@@ -393,8 +393,8 @@ function save_prefs() {
= $('#tbox_prefs_api_base').attr('value');
prefs.sign_api_base
= $('#tbox_prefs_sign_api_base').attr('value');
- prefs.search_api_base2
- = $('#tbox_prefs_search_api_base2').attr('value');
+ prefs.search_api_base3
+ = $('#tbox_prefs_search_api_base3').attr('value');
prefs.upload_api_base
= $('#tbox_prefs_upload_api_base').attr('value');
prefs.oauth_base
diff --git a/data/js/ui.template.js b/data/js/ui.template.js
index abec916..885175c 100644
--- data/js/ui.template.js
+++ data/js/ui.template.js
@@ -1388,9 +1388,9 @@ function (dataObj) {
}
} else {
if(now.diff(mobj, 'days', true) > 1) {
- time_str = mobj.format('MM-DD-YYYY HH:mm:ss');
+ time_str = mobj.format('YYYY-MM-DD HH:mm:ss');
} else {
- time_str = mobj.format('HH:mm:ss');
+ time_str = mobj.format('YYYY-MM-DD HH:mm:ss');
}
}