Using import.io with mouseover text - javascript

Long time viewer, first time poster!
I am having some trouble... I notice that apparently scraping mouseover text is an option when crawling webpages now (http://support.import.io/forums/199278-ideas-forum/suggestions/10368834-website-elements-displayed-on-mouseover), but I cannot figure out how to do this!
The type of page I am trying to do this on is this (which I will use for crawling on many similar pages): https://www.kickstarter.com/profile/1874304670 I am wanting the numbers in each section of the circle graph, along with the titles of those categories in the graph. This text only appears on mouseover. I cannot get this text to display when making my crawler, much less have the data scraped.
Alternatively, I could get the information if I could use the page source to extract the data, since the data is there before other code changes it into the graph. BUT, it seems that this functionality is not yet available with the crawler, only the extractor (from the best I can tell).
Any help on how to do this directly? Or maybe with some sort of workaround? Perhaps import.io isn't what I should be using for this, but it would be great if I could!
Thanks in advance!

There's no "out of the box" way to do this in import.io, there is a workaround if you know a bit about JS however...
if you use a custom xpath .//*[#id='small_circle'] you can get to a piece of json data that contains the information you want.
it's in this format:
[...{
"category_id":26,
"label":"Crafts",
"projects_backed":0,
"color":"rgba(0,0,0,0.0)",
"path":"/profile/1874304670?category_id=26&ref=wheel",
"data":1
},
...
]
You could do some post-processing after the crawling to filter out the relevant parts you wanted, or parse it with JS and just take the "label" and "projects_backed" keys.

Related

Library to display JS object in HTML in a way debuggers do

Currently I am looking for efficient (means made by someone else) way to represent JS objects inside HTML page. Ideally I should provide arbitrary object and library should make dropdown or popup with all properties of that object that can be selected and viewed as well. Final goal is to make object representation as close to modern JS debugger interface as possible.
In case if I didn't get my point accross I want to find libarary that would allow to represent object on web page as on picture below.
So I would like to ask if any of you know a libarary that can help me to do this.
Update: I found that firebug-lite-debug.js has similar functionality but such approach requires unknown amount of work to extract code I need
Upadate: I ended up using json-formatter-js. It is able to render any js object and do it in lasy way so only expanded part of object is taken into account. Therefore gigantic things as window can be displayed.
It sounds like you just want a pre-made widget that will display an object as HTML?
I'd probably start with something like html-stringify
It spits out a mostly clean HTML string with basic formatting. You could use that directly in your page, or add some additional styles to help match the style of your page. You can try it out on RunKit to see if it'll meet your needs.
(RunKit is a nice way to try out packages like this, so you can see what the output looks like without having to install them.)

Rank-order response carry-forward with images (Qualtrics)

I'm about to conduct a survey using Qualtrics for my thesis; which requires me to measure choice-induced attitude change using an initial ranking task, followed by a choice task with responses tailored for each participant according to their responses from the ranking task (let's say comparing the options they ranked 'fourth and fifth'), and then the same ranking task again.
I've been having a small problem with it, as Qualtrics doesn't let me impose the correct criteria on 'carry-forward responses' option (needs a little JavaScript code to be embedded into the choice question, apparently). Indeed I found a webpage with instructions on how to do the exact thing: http://kurtmunz.com/2015/05/28/rank-order-carry-forward-in-qualtrics-with-javascript/
Following this logic was partially successful, because it only displays the text associated with selected options, but not the images of the said options, unfortunately. Since displaying the images is critical to my experimental setup, I need to find a solution and I guess the code given in the link just isn't written with the whole image thing in mind.
I was wondering if anybody has faced the same problem and/or has a solution to this.
Thank you very much!!!!
Instead of using insert image, try adding the images to the choices using html. I think the html will become part of the piped choice text. For example:
Choice text<br><img src='xxx' alt='yyy'>
Change the JavaScript to use double quotes around the piped fields.
Personally, I prefer to use a web service to sort and return rankings.

What language do I need to learn to make make a script for my Epson receipt printer? (Manual link included)

The printer: TM-T88V
The Manual: https://files.support.epson.com/pdf/pos/bulk/tmt88v_swum_reve.pdf
A receipt-marker Web template for the printer: http://www.i-pos.nl/epson/
(Provided by Epson)
I'm a noob that doesn't know any computer languages. I've dug all I can but I still can't make sense of it all. I still don't know what I need to learn to print the receipts I want to print.
There's mention of XML, HTML, CSS, and Javascript. But I don't know which one I need to learn. And I don't want to waste time learning one I don't need for this specific purpose.
What I want is to make a receipt that looks very similar to that of another business who makes wonderful receipts, and who uses this printer.
Ideally this is just a txt document or something very simple that I can manually change the lines of and click print. I do not need any sort of POS program with text boxes, buttons, or anything on a website for now. I just need a simple, off-line, on-my-desktop type solution. I want to plug the printer into my computer, change a few lines of text or code, and print it and have it look like their receipt, except with my logo and address.
Even if I can figure out how to print a receipt I manually made in Illustrator. I'm content doing that as well.
Please help me figure this out.
Edit: Would it at all be possible to pay someone to make some sort of noob-friendly setup where I just change lines of text and click print and get the result I want?
Would this be costly?
Would I be better off learning how to do this myself?
According to this manual, page 64, it'll be Javascript. But this document talks about the TMT88V-i, and you have a TMT88V. I'd suggest you to try this out in order to be fixed.

How to take a screenshot of a HTML form?

I'm working on a project that's basically a web form that the user fills in. Once complete they can save a screenshot of the entire, complete form to use as a sort of pamphlet.
I'm trying to work out the best way to approach this programatically.
I have a simple prototype working using the canvas tag, but the text formatting options aren't good enough for what I need so I'm wondering if there's some other way to generate a screenshot of a HTML element.
If I may suggest, post the result to a webserver and create a nice PDF document from it using some reporting tool available.
In my opinion, this is the best, maintainable solution. No need for hacking it in HTML or Javascript. You can use your own logo, print layout, fonts, etc.

Change data in PDF from HTML/JS

I want to change text in my PDF document from webpage. It will be some sort of diploma. I have large illustration and the text on it. There will be two empty rows - "Name" and "Date". I wonder if there's a way to change the "name" on pdf? I know, that there is an interactive PDF, but i dont know how to instert variables to the document from HTML. Anyone can help me?
Or perhaps you know better way to do this? I have two variables from JS or from Cookies (date and name), and want to generate a diploma. I have that illustration, fancy font and text. I was trying to do that with generating PDF from HTML, but it was problem with parsing a giant picture, and it was trying to open a pop-up, but I cant do this like that. It must be on same page or new tab.
I think what you want to do is creating a new pdf, inserting the template and name and stuff. But I do not think it is possible with Javascript alone, but with an ajax call to your server. PHP for example got TCPDF library which is relatively easy to use.

Categories