unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#25445: Bug (Trunk): Redirect fails in Duckduckgo
@ 2017-01-14  5:34 Ian Dunn
  2017-01-14  7:13 ` npostavs
  0 siblings, 1 reply; 9+ messages in thread
From: Ian Dunn @ 2017-01-14  5:34 UTC (permalink / raw)
  To: 25445

[-- Attachment #1: Type: text/plain, Size: 225 bytes --]


    Due I believe to a change in Duckduckgo's API, eww is no longer able to work with Duckduckgo.  It appears that they are using a referrer tag with single quotes rather than double quotes.  The attached patch fixes this.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: eww.el.diff --]
[-- Type: text/x-diff, Size: 633 bytes --]

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index d42180719d..b051c1ac85 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -501,6 +501,7 @@ Currently this means either text/html or application/xhtml+xml."
              (< eww-redirect-level 5))
     (when-let (refresh (dom-attr dom 'content))
       (when (or (string-match "^\\([0-9]+\\) *;.*url=\"\\([^\"]+\\)\"" refresh)
+                (string-match "^\\([0-9]+\\) *;.*url='\\([^ ]+\\)'" refresh)
                 (string-match "^\\([0-9]+\\) *;.*url=\\([^ ]+\\)" refresh))
         (let ((timeout (match-string 1 refresh))
               (url (match-string 2 refresh))

[-- Attachment #3: Type: text/plain, Size: 13 bytes --]


--
Ian Dunn

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#25445: Bug (Trunk): Redirect fails in Duckduckgo
  2017-01-14  5:34 bug#25445: Bug (Trunk): Redirect fails in Duckduckgo Ian Dunn
@ 2017-01-14  7:13 ` npostavs
  2017-01-14 14:34   ` Ian Dunn
  0 siblings, 1 reply; 9+ messages in thread
From: npostavs @ 2017-01-14  7:13 UTC (permalink / raw)
  To: Ian Dunn; +Cc: 25445

Ian Dunn <dunni@gnu.org> writes:

>        (when (or (string-match "^\\([0-9]+\\) *;.*url=\"\\([^\"]+\\)\"" refresh)
> +                (string-match "^\\([0-9]+\\) *;.*url='\\([^ ]+\\)'" refresh)
                                                        '\\([^']+\\)'
Shouldn't there be a single quote instead of space in the square brackets?

>                  (string-match "^\\([0-9]+\\) *;.*url=\\([^ ]+\\)" refresh))





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#25445: Bug (Trunk): Redirect fails in Duckduckgo
  2017-01-14  7:13 ` npostavs
@ 2017-01-14 14:34   ` Ian Dunn
  2017-01-16  0:35     ` npostavs
  0 siblings, 1 reply; 9+ messages in thread
From: Ian Dunn @ 2017-01-14 14:34 UTC (permalink / raw)
  To: npostavs; +Cc: 25445

npostavs@users.sourceforge.net writes:

> Ian Dunn <dunni@gnu.org> writes:
>
>>        (when (or (string-match "^\\([0-9]+\\) *;.*url=\"\\([^\"]+\\)\"" refresh)
>> +                (string-match "^\\([0-9]+\\) *;.*url='\\([^ ]+\\)'" refresh)
>                                                         '\\([^']+\\)'
> Shouldn't there be a single quote instead of space in the square brackets?
>
>>                  (string-match "^\\([0-9]+\\) *;.*url=\\([^ ]+\\)" refresh))
>

Yes.  I missed that when I copied it from the line below.

-- 
Ian Dunn





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#25445: Bug (Trunk): Redirect fails in Duckduckgo
  2017-01-14 14:34   ` Ian Dunn
@ 2017-01-16  0:35     ` npostavs
  2017-01-16  3:33       ` Eli Zaretskii
  2017-01-16 18:12       ` Achim Gratz
  0 siblings, 2 replies; 9+ messages in thread
From: npostavs @ 2017-01-16  0:35 UTC (permalink / raw)
  To: Ian Dunn; +Cc: 25445

[-- Attachment #1: Type: text/plain, Size: 133 bytes --]

tags 25445 patch
quit

Right, so I guess this should actually go to emacs-25 since eww-tag-meta
seems to be a new function in 25.1.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 916 bytes --]

From e1751dfb7ef5efbe1d79789f3d7b3a625dd8faab Mon Sep 17 00:00:00 2001
From: Ian Dunn <dunni@gnu.org>
Date: Sun, 15 Jan 2017 19:02:47 -0500
Subject: [PATCH v1] * lisp/net/eww.el (eww-tag-meta): Handle single quoted
 URLs (Bug#25445).

Copyright-paperwork-exempt: yes
---
 lisp/net/eww.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index d421807..90e7881 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -501,6 +501,7 @@ eww-tag-meta
              (< eww-redirect-level 5))
     (when-let (refresh (dom-attr dom 'content))
       (when (or (string-match "^\\([0-9]+\\) *;.*url=\"\\([^\"]+\\)\"" refresh)
+                (string-match "^\\([0-9]+\\) *;.*url=\'\\([^\']+\\)\'" refresh)
                 (string-match "^\\([0-9]+\\) *;.*url=\\([^ ]+\\)" refresh))
         (let ((timeout (match-string 1 refresh))
               (url (match-string 2 refresh))
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#25445: Bug (Trunk): Redirect fails in Duckduckgo
  2017-01-16  0:35     ` npostavs
@ 2017-01-16  3:33       ` Eli Zaretskii
  2017-01-16  4:27         ` npostavs
  2017-01-16 18:12       ` Achim Gratz
  1 sibling, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2017-01-16  3:33 UTC (permalink / raw)
  To: npostavs; +Cc: dunni, 25445

> From: npostavs@users.sourceforge.net
> Date: Sun, 15 Jan 2017 19:35:51 -0500
> Cc: 25445@debbugs.gnu.org
> 
> Right, so I guess this should actually go to emacs-25 since eww-tag-meta
> seems to be a new function in 25.1.

Pushing to emacs-25 is fine with me, thanks.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#25445: Bug (Trunk): Redirect fails in Duckduckgo
  2017-01-16  3:33       ` Eli Zaretskii
@ 2017-01-16  4:27         ` npostavs
  0 siblings, 0 replies; 9+ messages in thread
From: npostavs @ 2017-01-16  4:27 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25445, dunni

tags 25445 fixed
close 25445 25.2
quit

Eli Zaretskii <eliz@gnu.org> writes:

>> From: npostavs@users.sourceforge.net
>> Date: Sun, 15 Jan 2017 19:35:51 -0500
>> Cc: 25445@debbugs.gnu.org
>> 
>> Right, so I guess this should actually go to emacs-25 since eww-tag-meta
>> seems to be a new function in 25.1.
>
> Pushing to emacs-25 is fine with me, thanks.

Done.

2017-01-15 23:24:38 -0500 24a5f57ac3206c05e3a3c19837f96327f008c071
  * lisp/net/eww.el (eww-tag-meta): Handle single quoted URLs (Bug#25445).





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#25445: Bug (Trunk): Redirect fails in Duckduckgo
  2017-01-16  0:35     ` npostavs
  2017-01-16  3:33       ` Eli Zaretskii
@ 2017-01-16 18:12       ` Achim Gratz
  2017-01-16 18:24         ` Noam Postavsky
  1 sibling, 1 reply; 9+ messages in thread
From: Achim Gratz @ 2017-01-16 18:12 UTC (permalink / raw)
  To: 25445

npostavs@users.sourceforge.net writes:
>        (when (or (string-match "^\\([0-9]+\\) *;.*url=\"\\([^\"]+\\)\"" refresh)
> +                (string-match "^\\([0-9]+\\) *;.*url=\'\\([^\']+\\)\'" refresh)
>                  (string-match "^\\([0-9]+\\) *;.*url=\\([^ ]+\\)" refresh))

Why not use a regex with alternatives and do just a single match?


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Samples for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldSamplesExtra






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#25445: Bug (Trunk): Redirect fails in Duckduckgo
  2017-01-16 18:12       ` Achim Gratz
@ 2017-01-16 18:24         ` Noam Postavsky
  2017-01-16 19:24           ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Noam Postavsky @ 2017-01-16 18:24 UTC (permalink / raw)
  To: Achim Gratz; +Cc: 25445

On Mon, Jan 16, 2017 at 1:12 PM, Achim Gratz <Stromeko@nexgo.de> wrote:
> npostavs@users.sourceforge.net writes:
>>        (when (or (string-match "^\\([0-9]+\\) *;.*url=\"\\([^\"]+\\)\"" refresh)
>> +                (string-match "^\\([0-9]+\\) *;.*url=\'\\([^\']+\\)\'" refresh)
>>                  (string-match "^\\([0-9]+\\) *;.*url=\\([^ ]+\\)" refresh))
>
> Why not use a regex with alternatives and do just a single match?

Stefan made the same suggestion:
https://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00268.html

I'm not entirely sure it's an improvement.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#25445: Bug (Trunk): Redirect fails in Duckduckgo
  2017-01-16 18:24         ` Noam Postavsky
@ 2017-01-16 19:24           ` Eli Zaretskii
  0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2017-01-16 19:24 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Stromeko, 25445

> From: Noam Postavsky <npostavs@users.sourceforge.net>
> Date: Mon, 16 Jan 2017 13:24:08 -0500
> Cc: 25445@debbugs.gnu.org
> 
> On Mon, Jan 16, 2017 at 1:12 PM, Achim Gratz <Stromeko@nexgo.de> wrote:
> > npostavs@users.sourceforge.net writes:
> >>        (when (or (string-match "^\\([0-9]+\\) *;.*url=\"\\([^\"]+\\)\"" refresh)
> >> +                (string-match "^\\([0-9]+\\) *;.*url=\'\\([^\']+\\)\'" refresh)
> >>                  (string-match "^\\([0-9]+\\) *;.*url=\\([^ ]+\\)" refresh))
> >
> > Why not use a regex with alternatives and do just a single match?
> 
> Stefan made the same suggestion:
> https://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00268.html
> 
> I'm not entirely sure it's an improvement.

Neither am I: it would make the regexp harder to interpret (for
humans).





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-01-16 19:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-14  5:34 bug#25445: Bug (Trunk): Redirect fails in Duckduckgo Ian Dunn
2017-01-14  7:13 ` npostavs
2017-01-14 14:34   ` Ian Dunn
2017-01-16  0:35     ` npostavs
2017-01-16  3:33       ` Eli Zaretskii
2017-01-16  4:27         ` npostavs
2017-01-16 18:12       ` Achim Gratz
2017-01-16 18:24         ` Noam Postavsky
2017-01-16 19:24           ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).