Is there a way to extract the results from "count" operator in the final output on Yahoo! Pipes? For example, I am looking at the number of postings on my RSS news feed. I just want to know how many postings were there. So far I have been unable to retrieve the frequency number in the "Pipe Output." Please advise. Thanks!
The JSON result of your pipe includes a "count" property with the number of items returned. (Click "Get as JSON" on the pipe's page)
e.g. JSON output for a pipe.
You could also make a pipe to just return the count of an RSS feed.
Related
If I send two sentences (delimited by newline) in the body of a POST request to the simple CoreNLP server, the two sentences get analyzed as one, and the returned list of JSON object contains only one element. What settings do I have to pass to the server, so that each sentences is analyzed separately, and results are returned as a list of two JSON objects, one for each sentence?
Screenshot of a POST request and the returned JSON array containing only one element
Setting the property "ssplit.eonly":"true" does not seem to help either:
Turning on ssplit.eonly does not help
Add "ssplit.eolonly": "true" to your JSON.
I'm trying to fetch the yammer Followers using below rest API.
https://www.yammer.com/api/v1/users.json
Api contains details for each user. From this I need to extract followers count alone.
{"type":"user","id":1517006975,"network_id":461,"stats":{"following":0,"followers":0,"updates":0}}
Rate limit for per page is 50, as we have 100 000+ users I need to iterate 2000+ times to get the whole dump which is actually slow.
So I need method to directly extract the necessary data.
I am using shell script + pentaho .
I think you have two options.
If you are bound to shell, you could run the json response through a series of sed silliness to get to a list that you can then parse more effectively with shell tools. something like: curl http://foo.com | sed 's/,/\n/g'
will get you something more row based, and then you can start to parse it out from there using more sed or awk or cut and tr.
look at jq? it is a statically linked standalone c binary that allows really nice filtering of json
I am merging two feeds using Yahoo pipes and using the output feed on a website. However, as would like to identify the "feed source" for each item in the output feed. Is it possible to manipulate the original feeds so I can add another node/element to the feed items?
Thanks
One way to do that is using the Regex operator. Let's say you want to add a new field called source. You could use Regex with parameters:
In: item.source
replace: .*
with: (the text you want)
See it in action here:
http://pipes.yahoo.com/janos/7a3b9993cfc143d414fe7b637b1bd95a
That is, I have two feeds, I added a source attribute in the first with value "Question 1" and in the second with value "Question 2".
As an added bonus interesting undocumented Yahoo Pipes hack, I used one more Regex after the Union to make the source appear in the title.
However, this only adds the attribute to the node in the pipe debugger. You can use it for further processing, like I added it here to the title, it won't create a <source> tag in the output. That's because the RSS output of Yahoo Pipes removes all other fields that are not in the RSS standard. You can still see it in the JSON output though.
I have a pipe which is attempting to extract a youtube id from a youtube channel feed.
I have:
Fetch Feed -> Sub Element (item.link) -> Truncate (After 1) -> Regex (blah) -> Output
My problem is the output is:
0
content ABGmhMBBGgw
I can't seem to put this output into a string builder because it's an object (maybe array?).
So how can I extract the raw string out of this object array thing I have now.
As an option, you can use the pipe module called "create RSS" and make it's tittle from regexp result.
It will contain desired string as title instead of given 0, but will be an array anyway.
A demo showing how to extract latest video from a Youtube channel and embed into a webpage, all done with javascript and a Yahoo Pipe can be found at... http://lovelogic.net/z_tuts/ytgrab3.html
Just right click to view the page source and learn how the JSON from the yahoo pipe is decoded then swapped into the HTML, details of the pipe itself can be found here http://pipes.yahoo.com/pipes/pipe.info?_id=19431b877cc39a2d5fe8efa00bd86009
I have a pipe that filters an RSS feed and removes any item that contains "stopwords" that I've chosen. Currently I've manually created a filter for each stopword in the pipe editor, but the more logical way is to read these from a file. I've figured out how to read the stopwords out of the text file, but how do I apply the filter operator to the feed, once for every stopword?
The documentation states explicitly that operators can't be applied within the loop construct, but hopefully I'm missing something here.
You're not missing anything - the filter operator can't go in a loop.
Your best bet might be to generate a regex out of the stopwords and filter using that. e.g. generate a string like (word1|word2|word3|...|wordN).
You may have to escape any odd characters. Also I'm not sure how long a regex can be so you might have to chunk it over multiple filter rules.
In addition to Gavin Brock's answer the following Yahoo Pipes
filters the feed items (title, description, link and author) according to multiple stopwords:
Pipes Info
Pipes Edit
Pipes Demo
Inputs
_render=rss
feed=http://example.com/feed.rss
stopwords=word1-word2-word3