'''
searx is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

searx is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with searx. If not, see < http://www.gnu.org/licenses/ >.

(C) 2015 by Adam Tauber, <asciimoo@gmail.com>
'''
from flask_babel import gettext
import re
name = "Self Informations"
description = gettext('Displays your IP if the query is "ip" and your user agent if the query contains "user agent".')
default_on = True


# Self User Agent regex
p = re.compile('.*user[ -]agent.*', re.IGNORECASE)


# attach callback to the post search hook
#  request: flask request object
#  ctx: the whole local context of the pre search hook
def post_search(request, ctx):
    if ctx['search'].query == 'ip':
        x_forwarded_for = request.headers.getlist("X-Forwarded-For")
        if x_forwarded_for:
            ip = x_forwarded_for[0]
        else:
            ip = request.remote_addr
        ctx['search'].result_container.answers.clear()
        ctx['search'].result_container.answers.add(ip)
    elif p.match(ctx['search'].query):
        ua = request.user_agent
        ctx['search'].result_container.answers.clear()
        ctx['search'].result_container.answers.add(ua)
    return True

searx/plugins/self_info.py
'''
searx is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

searx is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with searx. If not, see < http://www.gnu.org/licenses/ >.

(C) 2015 by Adam Tauber, <asciimoo@gmail.com>
'''
from flask_babel import gettext
import re
name = "Self Informations"
description = gettext('Displays your IP if the query is "ip" and your user agent if the query contains "user agent".')
default_on = True


# Self User Agent regex
p = re.compile('.*user[ -]agent.*', re.IGNORECASE)


# attach callback to the post search hook
#  request: flask request object
#  ctx: the whole local context of the pre search hook
def post_search(request, ctx):
    if ctx['search'].pageno > 1:
        return True
    if ctx['search'].query == 'ip':
        x_forwarded_for = request.headers.getlist("X-Forwarded-For")
        if x_forwarded_for:
            ip = x_forwarded_for[0]
        else:
            ip = request.remote_addr
        ctx['search'].result_container.answers.clear()
        ctx['search'].result_container.answers.add(ip)
    elif p.match(ctx['search'].query):
        ua = request.user_agent
        ctx['search'].result_container.answers.clear()
        ctx['search'].result_container.answers.add(ua)
    return True

searx/plugins/self_info.py
diff --git a/searx/plugins/self_info.py b/searx/plugins/self_info.py
index 75cbae0dea..438274c410 100644
--- a/searx/plugins/self_info.py
+++ b/searx/plugins/self_info.py
@@ -29,6 +29,8 @@
 #  request: flask request object
 #  ctx: the whole local context of the pre search hook
 def post_search(request, ctx):
+    if ctx['search'].pageno > 1:
+        return True
     if ctx['search'].query == 'ip':
         x_forwarded_for = request.headers.getlist("X-Forwarded-For")
         if x_forwarded_for:
diff --git a/tests/unit/test_plugins.py b/tests/unit/test_plugins.py
index 98d39ec14d..b8a8980cfc 100644
--- a/tests/unit/test_plugins.py
+++ b/tests/unit/test_plugins.py
@@ -52,23 +52,39 @@ def test_PluginStore_init(self):
         request = Mock(user_plugins=store.plugins,
                        remote_addr='127.0.0.1')
         request.headers.getlist.return_value = []
-        ctx = get_search_mock(query='ip')
+        ctx = get_search_mock(query='ip', pageno=1)
         store.call('post_search', request, ctx)
         self.assertTrue('127.0.0.1' in ctx['search'].result_container.answers)
 
+        ctx = get_search_mock(query='ip', pageno=2)
+        store.call('post_search', request, ctx)
+        self.assertFalse('127.0.0.1' in ctx['search'].result_container.answers)
+
         # User agent test
         request = Mock(user_plugins=store.plugins,
                        user_agent='Mock')
         request.headers.getlist.return_value = []
 
-        ctx = get_search_mock(query='user-agent')
+        ctx = get_search_mock(query='user-agent', pageno=1)
         store.call('post_search', request, ctx)
         self.assertTrue('Mock' in ctx['search'].result_container.answers)
 
-        ctx = get_search_mock(query='user-agent')
+        ctx = get_search_mock(query='user-agent', pageno=2)
+        store.call('post_search', request, ctx)
+        self.assertFalse('Mock' in ctx['search'].result_container.answers)
+
+        ctx = get_search_mock(query='user-agent', pageno=1)
         store.call('post_search', request, ctx)
         self.assertTrue('Mock' in ctx['search'].result_container.answers)
 
-        ctx = get_search_mock(query='What is my User-Agent?')
+        ctx = get_search_mock(query='user-agent', pageno=2)
+        store.call('post_search', request, ctx)
+        self.assertFalse('Mock' in ctx['search'].result_container.answers)
+
+        ctx = get_search_mock(query='What is my User-Agent?', pageno=1)
         store.call('post_search', request, ctx)
         self.assertTrue('Mock' in ctx['search'].result_container.answers)
+
+        ctx = get_search_mock(query='What is my User-Agent?', pageno=2)
+        store.call('post_search', request, ctx)
+        self.assertFalse('Mock' in ctx['search'].result_container.answers)

Infinite scroll: answer are repeated on each page
How to reproduce : search for ["user agent"](https://searx.me/?q=user+agent) with Infinite scroll activated.

Should the answer be disabled except the first page ? or should Infinite Scroll hide the answer ?

I vote for the first option : disabled answers except on the first page on the server side. 

