Receive 5 results, with title, "extract (description)" and link to the articles - api

https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts%7Cinfo&exintro=&explaintext=&titles=Apple%20Inc.&inprop=url
This api already has what I need, but it only shows me the first result. I need it to have at least 5 and I don't know how to do it.
I need it to show all 5 results at least in order to use it. How can I get it?

Related

Surrounding Events in KQL or Matching on Multiple Conditions

Coming from a ELK background, Kibana had some nice functionality where you could view surrounding events of any record you wished https://www.elastic.co/guide/en/kibana/current/discover-document-context.html, i.e. view the 5 preceding and 5 proceeding events.
Does something like this exist in the Kusto Query Language?
Edit: I should also mention the requirement for this as I realise it might exist, but within a different form.
I'm looking to find several events that need to have all occurred during a specific time period, i.e. the previous 5 minutes.
Example; if EventID's 1, 2 and 3 show, I'm not interested. However, if 1, 2, 3 and 4 show (within X minutes of each other) then I would like my query to pick this up.
Any hints or tips are appreciated.
It seems that Time Window Join is what I needed - https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/join-timewindow

Splunk Failed Login Report

I am relatively new to Splunk and I am trying to create a reportthat will display a hostname and the amount of times that host failed to login within the past five minutes, when they failed 3 or more times. The only way I was able to get the initial search results I want is to look only within the past 5 minutes, as you can see in my query:
index="wineventlog" EventCode=4625 earliest=-5min | stats count by host,_time | stats count by host | search count > 2
This returns the host and the count. The issue is if I use this query in my report, it can run every five minutes, but the hosts that were listed previously get removed as they no longer are included in the search results.
I found ways to generate logs that I can then search for separately (http://docs.splunk.com/Documentation/Splunk/6.6.2/Alert/LogEvents) but it didn't work the way I expected.
I am looking for an answer to any of these questions that can help me get the intended results:
Can my original search be improved to still only get results where the failed logins were within 5 minutes but be able to search over any time period?
Is there a way to send the results from the query I already have to a report, where the results will not be cleared out when the search is run again?
Is there any other option I haven't considered to achieve the desired result?
If you only care about the last 5 minutes then search only the last 5 minutes. Searching more is just wasting resources.
Consider writing your results to a summary index (using collect) with a scheduled search and have your report/dashboard display values from the summary index.

How can I get all groups of city by vk API?

I am using vk.com api and I need to get all groups of city. I have found groups.search method (https://vk.com/dev/groups.search). But groups.search method require a 'q' string parameter (substring which must be part of the group name), which is bad for me, becouse the group name does not matter in this case.
I'm working with VK API for 4 years. The main thing you need to know about parsing any data from VK is that any search allow you to get just first thousand of results.
Group searching, people searching - you'll find only first 1000 items. It's fixed rule. Also there is no difference about number of found results (you can see, for example, 123456789 found groups. Scrolling opportunity will be finished as soon as you reach 1000th item)
So, basing on that fact the one decision you have is to parse all symbols in their different positions and groups as 'q' parameter so you will have to get a lot of groups. 'city_id' and 'country_id' can be found in source of element for their selecting if you need.

facebook shares count not accurate

may i know why this three urls return difference of count?
https://www.facebook.com/plugins/like.php?href=http://www.rotikaya.com/iqram-dinzly-tinggalkan-jalan-jalan-cari-makan-kerana-takut-gemuk/&layout=standard&show_faces=false&width=300&action=like&colorscheme=light&height=30
https://graph.facebook.com/?id=http://www.rotikaya.com/iqram-dinzly-tinggalkan-jalan-jalan-cari-makan-kerana-takut-gemuk/
http://api.facebook.com/restserver.php?method=links.getStats&format=json&urls=http://www.rotikaya.com/iqram-dinzly-tinggalkan-jalan-jalan-cari-makan-kerana-takut-gemuk/
(deprecated but more accurate)
The Graph link is intended to reflect the number a like button would show, which is an combination of several metrics.
The getStats endpoint does a more detailed breakdown. If you look at the total value on it, you'll see they match up.
https://graph.facebook.com/?id=http://www.imdb.com/title/tt0117500/
This displays total of likes and the deprecated shares as a whole
http://api.facebook.com/restserver.php?method=links.getStats&format=json&urls=http://www.imdb.com/title/tt0117500/
This one displays all the data, as you can see if you add the like count and share count it is just the same with the previous URL

rails order by field and get 10 items from the middle

I have build a page that displays a list of ratings in an desc order.
I want to display only 10 items at a time. how do I select only, say the 11-20 rows
from the ordered array.
Is it possible to handle this in the query itself, or do i have to fetch the whole table and screen the relevant items?
#pics = Rating.order('rating desc').limit(10)
In this specific case, use .offset(10) in your current query.
In general, search for "rails pagination" on google or here on SO.