xls form for conducting survey using android phone - xls

Am working on an xls survey form which when I loaded onto ODK to look for errors it produced this error"You must have a sheet named(case-sensitive):survey"which I dont quite understand.

It's referring to the worksheet in your excel file. Instead of the normal "Sheet 1" etc it needs to be named "survey".
I recommend you use http://ona.io to load and manage your forms. You can sign up and create an account there.. then your profile URL becomes the server URL that you have to enter in the ODK Collect app on the phone. They have given a basic example xlsform that should help you get started.. https://ona.io/examples/
Further documentation on making XLSForms : http://xlsform.org

Related

Download Highcharts Generated Table into R

I'm trying to download a csv file of data corresponding to the chart on the below website:
http://vixcentral.com/
If I click on the menu button on the top right of the chart there's an option to download the chart data into a csv.
The issue is that that button seems to generate a download link that only works temporarily, so I'm unable to use a regular downloader such as read_csv or rio::import to pull the file into R.
It seems both the chart and the download link are generated by the Highcharts javascript.
Is there any straightforward way to download this data into R by figuring out the link?
Or does it have to be a scraping excercise?
If you right-click on the screen and press 'Inspect Element', then go to the 'Network' tab, you can see xhr requests being done to obtain data (for example while clicking around the different charts).
You noted that you're interested in the result of http://vixcentral.com/ajax_update/?_=1590762673737.
The number in the end of this URL is the Unix epoch of the current time. That's why it changes.
There is a little bit of security from scraping in the sense that they try to block requests that do not come from their own site. By setting the header X-Requested-With to "XMLHttpRequest", it works. You can view the headers used for this request by clicking on it in the 'inspect element' screen of your browser. There are a bunch of headers being set, and by removing each one and testing, I found out that this is the only one that's needed for your purpose.
Below reads the data and parses it into an R object using jsonlite.
res <- httr::GET("http://vixcentral.com/ajax_update/?_=1590762673737",
add_headers("X-Requested-With" = "XMLHttpRequest"))
res_text <- content(res, "text")
jsonlite::fromJSON(res_text)

2sxc | Display multiple files with Adam upload

I can upload multiple files (documents in this case) at the same time very well. Is it possible to have a hyperlink field with multiple adam files dropped into it or even a plus ('+') icon to add another without having to drop on another app each time?
UPDATE:
Sorry I overlooked ADAM 1.2 (link below) feature to use hyperlink 'Library' for multi file selection.
https://2sxc.org/en/blog/post/introducing-adam-1-2-with-folders-metadata-and-c-sharp-api
I have been able multi select now but still having difficulty with using the file picker to create the folder structure I wish to achieve:
I read from link above:
You can create even another content-type - like Application Group Metadata - which you can use as folder-metadata. This allows the editor to tag each folder with additional information.
I do not fully understand how to use this 'folder-metadata' to achieve the same thing as the file manager allows me to do by specifying where each file is to be stored?

Scraping does not return the desired data

I am trying to get data from the site https://bill.torrentpower.com/. I desire to input the city "Ahmedabad" and Service number "3031629" and extract the table which gives the bill details.
My code is simple
a<- postForm("https://bill.torrentpower.com/billdetails.aspx",
"ctl00$cph1$drpCity" = 1,
"ctl00$cph1$txtServiceNo" = "3031629",
.opts = list(ssl.verifypeer = FALSE)
)
write(a,file="a.html")
When I open the file a.html, I do not see the table containing the bill details. All other details are visible on a.html. My aim is to capture the tablular output as an R object.
The issue here is that the table is generated by the JavaScript code after the page has loaded and hence you will not get the content of the table.
This is a common problem with scraping information that has lots of dynamic content.
A work around this is to stimulate a web browser using RSelenium.
http://cran.r-project.org/web/packages/RSelenium/RSelenium.pdf
This will stimulate with web browser in your R session and you can navigate the webpages using various methdos ( see the user manual for info)
Personally, I find RSelenium with PhantomJS combination the most useful since I use a lot of JavaScript. Alternatively, if you find using R Syntax abit troublesome you may use PhantomJS on its own as well. http://phantomjs.org/

Upload file with CMIS Service on st:site

I have been uploading files to Company Home pretty easily with this url:
http://myhost.com:8080/alfresco/s/api/path/workspace/SpacesStore/app:company_home/children
Now I am trying to upload to a folder within a site
http://myhost.com:8080/alfresco/s/api/path/workspace/SpacesStore/app:company_home/st:sites/cm:mysite/children
And keep getting this
Cannot find object for NodePathReference[storeRef=workspace://SpacesStore,path=app:company_home/st:sites/cm:mysite]
Am I missing a special way to declare the path of a site?
i'm not sure how you are uploading to that path but i suppose you need to go into 'documentLibrary' of the site
http://myhost.com:8080/alfresco/s/api/path/workspace/SpacesStore/app:company_home/st:sites/cm:mysite/cm:documentLibrary/children
I found out that there are 6 webscripts related to file manipulation, and it seams each one takes the path in a different way.
I ended up using
http://example.com:8080/alfresco/s/cmis/p/Sites/mySite/Test/children
This particular service it takes Display Names as path segments, and the p itself represents the Company Home segment
I also obtained the same results with this one
http://example.com:8080/alfresco/s/cmis/s/workspace:SpacesStore/i/2aa692bd-0dab-4514-a629-ad36382189f2/children
Which as you can see takes nodeRef Ids as parameter.

Clicking on one of the link from multiple option present in the file using selenium (Java)

I have one file to read as below
contains a #href ENVIRONMENT*somexyzsite=####
contains a #href javascript:XYZ VolunteerRegistration
contains a #href javascript:ABC VolunteerNavigation %20 REGISTRATION_LINK
contains a #href javascript:PQR VolunteerNavigation VOL_REGISTRATION_LINK
= a #title New Volunteer Signup
After loading a particular webpage I need to go to one of the registration link mention above.
I also need to check the links specified above are applicable to that webpage or not?
ANd if its applicable then I need to navigate to that link
I don't understand how can we proceed with this using webdriver.
Can anyone help me get to start with this function?

Resources