GoCD compare output in json in bash - go-cd

My situation is that i need to be able to get the gocd compare result in the form of json in bash, so that i can extract the commit ids from the output.
https://<go server url>/go/compare/<pipeline name>/<old build>/with/<new build>
The output of the above url in a GET (with authentication is an html document).
However i need to be able to get this in JSON format so that i can fetch the commit ids list from the comparison page output. Please suggest if there are any ideas.

Related

ElasticSearch search pdf document for content

I'm working on a project leveraging AWS Lex chatbot and ElasticSearch. My goal is to parse a query with the intent of searching a single pdf document and pulling out some relevant information.
I'm under the impression this is possible with ElasticSearch, though my research has reached a roadblock. I understand ElasticSearch has the ability to index documents, but that seems to be limited to indexing actual files for the search of files that match the query. I'm hoping to snag actual content within the PDF document and attempt to pull some content out based on a query. Is this possible?
Elasticsearch can't index PDFs directly. You can extract the text of the PDF, index it, then query as usual. Apache Tika "detects and extracts metadata and text from over a thousand different file types (such as PPT, XLS, and PDF)."
You can run Tika as a Docker container: docker-tikaserver
To index a PDF, send your data to Tika (for this example, running as a docker container accessible via http://tika:9998), get the text, and index it:
doc = {...} # other content to index
try:
# open PDF and read contents into data
# send content to tika to extract text
doc["content"] = requests.put("http://tika:9998/tika", data=data).text
es.index(index="my-index", id=doc["id"], body=doc))
except Exception as e:
log.error("error extracting text: %s", e)

Informatica Power center-- How to pass multiple values from transformation to HTTP transformation Base URL

Trying to pass multiple values in the HTTP transformation URL(Put method) but unable to do it. URL doesn't support query strings
Example:
URL: http://example.com/**page**
need to pass multiple values into the page(please see the URL) from another transformation. URL does not support the query string values. Any Idea how to pass multiple values to the URL.
Page values like "1234", "5678", "891". So the URL will be as shown below.
http://example.com/1234,
http://example.com/5678,
http://example.com/891
Thank you
If page numbers are finite,
then you can create that many http transformations in a mapping.
If page numbers are infinite or many, you need to-
create a list of pages, create a mapping with http transformations where http://example.com/$pageno
create a shell script which will iterate through above list, create a param file with $pageno=1234 etc. and kick off above mapping with this param file.
schedule this shell script using another workflow.
HTH

Postman body request with values from data file

So i'm using postman, I have an URL that I can send POST request to, with a single json in the body where the key is "coupon" and the value is some number.
I want to run a test from postman that will place different numbers to the value of the coupon, and see all the responses that I will get.
I tried to read about the runner in postman, I figured that I can build a data file with all of the numbers for the coupon.
How can I replace the value in the post request with those numbers from the file data?
I'm trying to put a different number to this value, send it and get a response for each number.
Here
Thank you!
In the collection runner, load a CSV file that looks like:
value
123456
234567
345678
... and so on, one line for each coupon number. Then you replace the number in the key-value parameter editor with {{value}}. In the pre-request or test script, you could access it with data.value. See also the Postman documentation on working with data files.

REST uri to get data from community junction(CJ) fails

I am making REST calls to download reports from commission junction(CJ) but not able to fetch data. Instead I am able to manually download report with the desired column as
Account name,Campaign name,Ad group,Destination URL,Ad distribution,Impressions,Clicks, CTR,Average,CPC,Spend,Avg. position.
The REST uri I am using is
https://commission-detail.api.cj.com/v3/commissions?date-type=posting&start-date=2013-03-14&end-date=2013-04-14&action-types=impression
Is this the right REST uri to get the data for desired columns mentioned above.Please suggest.
I believe using v3 you can only get yesterdays data.
http://www.ericnagel.com/how-to-tips/commission-junction-web-services.html

Fetching Live update from cricinfo

I am working on fetching live updates from http://www.espncricinfo.com/wcldiv4-2012/engine/match/576414.html and what I have been able to do is fetch the live scorecarads with wget and regex, parsing the "title" of the page (which is scorecard).
But I am not able to fetch the commentary which when I use "firebug" I can see but when I wget to fetch the page those commentaries doesn't show up.
Is there anyway to use firebug with command line ? ( was wondering if I can then I could fetch those results.)
or what is the way to fetch those auto-update commentaries ?
I guess you should be able to use the following RSS on your site. You need to parse the relevant feed and and get going.
http://www.espncricinfo.com/ci/content/rss/feeds_rss_cricket.html
I doubt if cricinfo has its own API that you could leverage.
UPDATE 1: Cricinfo leverages yahoo pipes and merges these feeds, you can also leverage the same and the get the resultant pipe in JSON or XML format:
A simple pipe is here e-g:
http://pipes.yahoo.com/pipes/pipe.info?id=tMcVGcqn3BGvsT_2R2EvQ