rss help in iphone development - javascript

Since my last question was deleted without giving me a chance to reply: I want to build a similar rss parser feed to: http://misc.inexistent.org/ontd/
Can anyone give me really good tutorials that I could build a similar iphone app for my rss feed.
I can see it uses jquery, javascript, and ajax.
If any can check out the code to head me in the right direction.
Thanks!

If you are a paid Apple Developer, there is an excellent example project in the developer portal called Top Paid Apps. I've used part of that code in several projects that required XML parsing.
https://developer.apple.com/iphone/library/samplecode/TopPaid/Introduction/Intro.html
That should be all you need to parse an RSS feed and present it in a list view.

The example you have provided is a web page.
So any of the many online tutorials should help you create a browser based RSS parser that will work in a most web browsers, including iPhone/iPad safari, example.
You might then want to style it look more like a native iPhone app, dashcode could probably help you out here.

Related

is it possible to do some simple web scraping in chrome extension?

thanks in advance and Im sorry if this might not be a well formed question, I am relatively new to CS and stackoverflow.
I am hoping to make a simple chrome extension, which overrides the new tab page to display some simple data collected from a couple websites. I am wondering if it is possible to web scrape within the basic JS or chrome API's? Any information or guidance would be greatly appreciated, I have been trying to do research on the subject and haven't found any recent or clear answers to this.
Thanks for your help!
Here is an older stackoverflow question asking the same question but I wasn't able to make any progress from the answers.
Web Scraping in a Google Chrome Extension (JavaScript + Chrome APIs)
Absolutely and not just simple scraping.
If you think about it using the browser itself is as close as possible to replicating a real user session. You don't have to care about manually setting cookies, discover and construct json http requests. The browser does it all for you. After a page has been rendered (with or without javascript) you can access the DOM and extract any content you like.
Take a look at https://github.com/get-set-fetch/extension, an open source browser extension that does more than just basic scraping. It supports infinite scrolling, clicking and extracting content from single page javascript apps.
Disclaimer: I'm the extension author.
If you're serious about the subject start by developing a simple chrome extension (from my own experience Chrome throws more verbose extension errors than Firefox): https://developer.chrome.com/extensions/getstarted
Take a look afterwards at the main get-set-fetch background plugins: FetchPlugin (loads an url in a tab and waits for the DOM to stabilize), ExtractUrlPLugin (identifies additional urls to scrape from the current url), ExtractHtmlContentPlugin (actual scraping based on CSS selectors).
There are downsides though. It’s a lot easier to run a scraping script in your favorite language dumping the scraped content into a database than automatically starting the browser, loading the extension, controlling the extension, exporting scraped data to a format like csv, importing that data into a database.
In my opinion, it only makes sense to use a browser extension if you don’t want to automate the data extraction or the page you’re trying to scrape is so javascript heavy it’s easier to automate the extension than writing a scraping script.
I am wondering if it is possible to web scrape within the basic JS or chrome API's?
Yes, use fetch to call REST APIs.

use of google script editor

Hey so currently working on my first personal project so bear with the questions!
Currently trying to create a Javascript program that will parse info from google forms to produce slides displaying the info. So far from my research the best way I've found to facilitate this process is googles app script editor. However, I was wondering if I can run this code by requesting it from a different javascript (or maybe even java) program that I will write code on webstorm. If I cant do this what is the best way to utilize the google apps script editor?
Thanks!
Google Apps Script is just javascript with extra built-in APIs (like SpreadsheetApp, FormApp, etc.).
It also has a UrlFetchApp API.
So you can run code like this:
// The code below logs the HTML code of the Google home page.
var response = UrlFetchApp.fetch("http://www.google.com/");
Logger.log(response.getContentText());
As such, if you want to provide JavaScript from elsewhere, you could fetch it and then eval it on the Google Apps Script side. (but we all know how tricky eval can get)
One other option is to have your own server side written using Google App Engine (or any other framework) and use Google's OAuth and authorize your app to fetch data from the Forms form
Slides and Google Apps Script
You might like to take a look at the addon "Slides Merge" by Bruce McPherson. I've never used it but it sounds like it might work for you. Here's what it's looks like in the addon store:
Getting information from Google Forms is a snap with google apps script since your can link the form right up to a spreadsheet. The Google Apps Script documentation is really quite good these days. Here's the documentation link. Google Apps Script is loosely based on Javascript 1.6. If your already a programmer my guess is that you'll have few problems learning to use it. In my experience the most difficult thing was dealing with the arrays of arrays produced by the getValues() method of ranges in google apps script and I made a short video that might be of some help to you.
I also have a script that I wrote in Google Apps Script that produces a sheet show that is a slide show inside of a spreadsheet.
I've found that using the Script Editor is pretty easy. There's some documentation in the support section of the documentation. It can be a bit buggy at times but overall I think it's a pretty good tool.

Where could I find the useable-native-apis when coding NativeScript App?

The article accessing-native-apis-with-javascript tells us how to use naive-Apis with js code. It is good.
But, I don't know where is the native-Apis because I never come into Android. Is it a necessary to know basic of Android knowledges for all Nativescript learner?
So I turned to Android developer site to find the list, and I falled in an other rabbit hole. It is so complicate to me.
Can you give us a usable-native-Apis-list to access the native-Apis easily?
For example, I want to use device's contacts in my App, so I turn to Android-developer-guide site to find which API is the right one. I get a lot of APIs named "contact****", which one is the target? It's painful to seek the answer for a learner of Nativescript.
"The beauty of Nativescript is .....", I turn to Nativescript just because of these words.
But, if I should learn about all the native APIs to see the beauty in the end?
when you need to use native api , you can search for that , and you will find java code for that for example https://stackoverflow.com/a/12562234/4146943
In this answer you need getContentResolver then you search in android docs to get the package name of getContentResolver https://developer.android.com/reference/android/content/Context.html#getContentResolver()
In the begin of page you see android.content.Context so you can use android.content.Context.getContentResolver
Note :
knowing java and a little android develope with java wold really help.
Note2 : checking other plugins to see how others use native api really helps.

Creating a printable/downloadable PDF of a web application

I have been searching for an answer to this problem now for several weeks. I also previously tried to research this a few years ago to no avail.
Problem Summary:
My company has developed a web-based data analytics suite for a major beverage distributor. They have recently asked for a feature that allows the user to print or download a visually pleasing version of the rendered app as a PDF. I have had no luck in finding a solid, controllable, or reliable method to do this. I was hoping the stack community might be able to point me in the right direction.
Current Tech Stack:
Plack servers
Perl base on the Dancer framework
Standard web dev front-ends: HTML5, CSS3, Javascript, Jquery/UI
Client is using IE9/10 and Chrome.
Attempted Solutions Summary:
Obviously I started with the window.print() and tried to control what printed using classes and a specialized print.css but the output was still awful.
I looked in to pdfmachine and pdfbox and even contacted Adobe's acrobat development team directly to see if they had an out of the box solution our company could purchase. I was informed that such a product would be counter intuitive to their desired business model of putting an acrobat subscription on each client computer rather than a single server side application.
I have extensively searched the stack articles but did not feel that the articles I found covered what I was looking for.
At present, I am all out of ideas and am hoping somebody out there has had better luck at this than I have.
tl;dr = I need a pdf version of the rendered output of a complex reporting app.
Thanks for your time stack, I appreciate it.
A solution I have used in the past is to use PhantomJS running on a server to generate the PDF for download/email. Usually if the content is sensitive the server (that handles authentication) would provide a single use viewing token that is then passed to a PhantomJS process. It loads the URL with the viewing token then saves as a PDF.
Further info on Phantoms screen cap API can be found here on GitHub.
https://github.com/ariya/phantomjs/wiki/Screen-Capture
Is it something you can create in Perl using PDF::API2 or PDF::Create? You can load and modify and existing PDF (handy if you want standard headers and footers), and then insert the relevant content. The learning curve can be a bit steep, but simple reports should be easy enough.
See PDF::TextBlock and PDF::Table too - they are great little helpers.
Consider this service http://pdfmyurl.com/ . I try to use many perl modules, but they dont satisfy my problems.

Automated Testing with Javascript for any web app - need more suggestions and ideas

BACKGROUND: I've been looking for auto-testing tools for my web-app developed in C# having AJAX. I tried to find some tools but some were complex, some were paid and some would not allow me to tweak in. Some are listed below but I wanted something on which I had the total control and would be v.light weight and easily portable.
My inspirations :)
http://watin.sourceforge.net
http://sahi.co.in/w/
http://seleniumhq.org/projects/ide/
SOLUTION: So, finally getting back to my old javascript skills I ended up creating my own simple (and hopefully effective) auto-testing tool! The idea was to create a wrapper parent html page which will 'host' the web-page to be tested in an iframe and then access its controls, populate value and perform clicks, etc...
*NOTE: Both the pages need to be on the same machine to be tested (cross
domain testing is not allowed)
Here's a sample image explaining my method -
And here's the wrapper page
code : http://www.codeupload.com/3813
I'd like to know your suggestions and idea about the same and what you prefer. I see many usage of this method like - auto-testing, showing an automated demo, automated-data-entry,... but everything on the same domain.
Here's my codeproject article:
http://www.codeproject.com/KB/custom-controls/JS-Automated-Testing.aspx
Please share your thoughts. And if some one is interested I've also posted a youtube video showing it live in action:
http://www.youtube.com/watch?v=j_z_IrFztBo
Thank you
PS: Hope this is not misleading, I'm not advertising, its just for sharing and learning ;)

Categories

Resources