Download all entries in RSS feed using ROME - rss

I'm using ROME from Scala to download RSS feeds, but it's only grabbing a subset of the entries. For example, Google Reader finds at least 61 entries for Bing Images, but ROME only finds 10 entries. Here's some code:
val sfi = new SyndFeedInput
val url = new URL("http://feeds.feedburner.com/bingimages")
val feed = sfi.build(new XmlReader(url))
println(feed.getEntries.size) // prints "10", but should find more
This isn't specific to the feed; this Flickr feed has many entries, but in this case ROME finds 20 entries.
How do I get the complete list of entries in the feed?

Related

The rtweet search query is returning way less tweets than in previous days

I am using the rtweet search query to look for tweets with 2 specific hashtags. I started on 1 Feb 2021 and until 5 Feb 2021 I was getting between 5000 to 10,000 tweets a day. Now I am returning around 800 tweets a day.
I then decided to have expand my search parameters now to include more hashtags, but I am still returning only 2000 tweets.
I thought that including the new hashtags would increase my returns because it would be searching tweets with those hashtags from the last 7 days? (I have the standard Twitter API)
I tried using trending hashtags like #friday but still only get 8-12% of the N=18,000 max return of tweets.
Also, on 5 Feb 2021, there was a new authentication requirement for my Twitter API, since then an internet browser automatically opens saying my account has been authorized and I can return to R.
Here is an example rtweet search query:
search_tweets(q = "#friday OR #monday -filter:retweets -filter:replies", lang = "en", n=18000, type = "recent", parse = FALSE, retryonratelimit= TRUE)
THANKS EVERYONE (:
https://developer.twitter.com/en/docs/twitter-api/enterprise/rules-and-filtering/operators-by-product
https://developer.twitter.com/en/docs/twitter-api/enterprise/rules-and-filtering/enterprise-operators
https://developer.twitter.com/en/docs/labs/filtered-stream/guides/search-queries
Important Note: The sample operator first reduces the scope of the firehose to X%, then the rule/filter is applied tio that sampled subset. If you are using, for example, sample:10, each Tweet has a 10% chance of being in the sample.
I'm not familiar with rtweet. It probably relies on an API endpoint that is affected by that change.
They want you to upgrade your API access. If you figure out an alternative solution, please post it as an answer.

Kibana: How to aggregate for all UUIDs

I am tracking my url hit counts and want to aggregate them.
I have a few URL as follows:
example.com/service/{uuid}
when I view in Kibana it lists out the total hit count of each URL individually so my table has something like:
example.com/homepage 100 count
example.com/service/uuid1 10 count
example.com/service/uuid2 5 count
Is there an easy way to combine all uuids into 1 entry?
I was thinking of replacing uuids with a static string, however the admins blocked regex support making the replacement very difficult. So I am trying to see if there is any other way before doing that.
Thanks!
I would suggest to create a new field with scripted fields.
The new field would return value: example.com/service/uuid if the url contains the word uuid. Otherwise it will return the url as it is.
Then you could do the aggregation on the new field.

WC API - Query across multiple products

I am setting up a site (WP) which will essentially sell one type of product and integrating a mobile app (ionic).
Multiple vendors can sell (WC Vendors) the variable product on the site at different quantities (100 litres, 200 litres etc).
I need to be able to make a GET request to return each vendors variable product for that quantity.
e.g. Customer selects they want 300 litres in the mobile app, I then use the API to return all variable products for that quantity (300 litres). So in the end, I have a response which will contain something like below;
Vendor: Vendor 1, Product: Product Name, Quantity: 300 litres, Price: £200
Is this possible as the WC API stands now?
For anyone else struggling on this, I finally got it to work by using the tags as suggested above and to query by tags using this;
https://example.com/wp-json/wc/v3/products?tag=20?consumer_key=ck_xxxxxxxxxxxxxxxxx&consumer_secret=cs_2xxxxxxxxxxxxx
I think you need to rephrase this a little bit, But From what I can get. You have a Vendor and a Product that has a Quantity of 300 L which in the first place I'd recommend you Should avoid, Rather just use Liter , Now what I'd Recommend is Tag's.
You'd have your Vendors and products under Categories.
And you can Set Tags on Products that you'd like to have what you require.
Then When someone Selects 300L , 200L It will pull every Product with the Tag 200L And you'll be able to display them.
Official Document
/wp-json/wc/v3/products/tags/<id>
They have:
id integer Unique identifier for the resource. name string Tag name.
slug string An alphanumeric identifier for the resource unique to its type.
description string HTML description of the resource.
count integer Number of published products for the resource.

Can Bing Search API V5 search for non english news articles

I attempted the following search on Bing Search API, limiting to News articles only:
$ms_api_url = "https://api.cognitive.microsoft.com/bing/v5.0/news/search?q=حج";
and
$ms_api_url = "https://api.cognitive.microsoft.com/bing/v5.0/news/search?q=%27%D8%AD%D8%AC%27"
and the results were very limited (55 articles) and nearly all English.
Can this API return non-english results?
mkt is an optional parameter to specify where the results are coming from. From the documentation:
Typically, this is the country where the user is making the request
from; however, it could be a different country if the user is not
located in a country where Bing delivers results. The market must be
in the form {language code}-{country code}. For example, en-US.
Full list of supported markets:
es-AR,en-AU,de-AT,nl-BE,fr-BE,pt-BR,en-CA,fr-CA,es-CL,da-DK,fi-FI,fr-FR,de-DE,zh-HK,en-IN,en-ID,en-IE,it-IT,ja-JP,ko-KR,en-MY,es-MX,nl-NL,en-NZ,no-NO,zh-CN,pl-PL,pt-PT,en-PH,ru-RU,ar-SA,en-ZA,es-ES,sv-SE,fr-CH,de-CH,zh-TW,tr-TR,en-GB,en-US,es-US

Merging three RSS feeds

I have a working RSS feed that places points onto a Google map using an RSS feed and xsl. My problem is i would like to merge at least two RSS feeds into one that can then be styled by the xsl and output to the google map.
Here is my current code
Dim rssFeedLoc As String = "http://examplesyndicationlink.uk/organisations/buildings/postcode/XXXXXX.rss?apikey=XXXXXX&range=12"
Dim xDoc As XPathDocument = New XPathDocument(rssFeedLoc)
Dim xNav As XPathNavigator = xDoc.CreateNavigator()
dlFindXMLResults.XPathNavigator = xNav
dlFindXMLResults.TransformSource = "/xsl/hello.xsl"
I would like to add the following feeds
Dim rssFeedLoc2 As String = "http://examplesyndicationlink.uk/organisations/buildings/postcode/XXXXXX.rss?apikey=XXXXXX&range=12&page2"
Dim rssFeedLoc3 As String = "http://examplesyndicationlink.uk/organisations/buildings/postcode/XXXXXX.rss?apikey=XXXXXX&range=12&page3"
Is there a way i can merge the 3 feeds into one? Would this require creating a temporary file on the server?
EDIT: I suppose when i say 'merge' i mean join together, the RSS feed is restricted to show only 10 results per page, i would like to join all the results from the 3 pages together? There would also be no duplicates as the pages are just a continuation of the results.
Instead of using XSL to do this have you considered Yahoo Pipes? That will allow you to combine as many RSS feeds as you like into one feed.

Resources