combining links into one [closed] - java

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I was wondering the best method and language to use for combining individual links into one "link?"
i.e. Normally the links are separated one by one in an email so you have to click each link individually, now I want to have it so the links are combined into one, so the user doesn't have to click each individual link but rather a "link."

I am assuming by "link" you mean a URL. A URL is a locator for a single resource (eg. web page). Typically when clicked, a browser window opens and the requested resource is presented. It does not open multiple browser windows and present multiple resources by itself.
You may be able to solve the problem by creating a URL to a web page that contains javascript to open multiple browser windows/tabs, each with the appropriate URL/resource.
If they are activation links, then you could use AJAX on a single web page to iteratively request each of the URLs in turn.

Related

Is there a simple way to allow access to my website only through my Android application? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
Is there like any method to only allow direct access to my website only from the Android application.
Any other requests coming from any where else being blocked or redirected to a restricted access page or similar.
Please do provide any ideas or simple solutions and any step by step procedure to do so would be greatly appreciated.
a little idea here:
Make all your request to index HTML and then redirect according to user agent
On index validate the request headers seeking for user agent and if it's not android then redirect to another site.
Info about user-agent at mozilla site: here
Edit: As MrWhite says, make sure that Android app sends a unique user-agent.

How to web scrape on server side? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm not sure if the title says what I needed. But that's the best way I can put it.
My requirement: I want to check if a series of engine numbers (of vehicles) are registered with the local transportation authority. They have provide a web-interface for this task, but I can only check for a single engine number at once. Usually I need to check over 200 numbers. So, its a humongous task to check each one individually.
A couple of years ago, I have created a small standalone python script to do this automatically using web scraping, but now I want to do this on a server.
A user gives all the numbers in the text file which they upload/paste the contents in to a text field. Then I'll have to submit the form on the transportation website (using web scraping) for each number and display a final status for all of them.
What I want to know is how to do this on a server? What technologies could be helpful. I'm comfortable with Java & JavaScript. I don't know PHP (But i can learn if needed). I don't have slightest Idea how to do this on server side. Any Ideas and Help is greatly appreciated.
Thanks.
Java has a library called JSoup, which provides a mostly-familiar api that uses css selectors.
And obviously there are built-in functions that can get you the html from a given URL.
Put those together and you've got a server-side scraper
[edit]
Your question, on a re-read, isn't just about scraping -- it's about how to automatically submit an html form from within Java to an external server. This is an interesting question, one I've wondered myself.
this may be an answer: How to send post form with java?

Software to control TOR browser [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to create a tool for automatically search on google some keyword defined by the user and give back the results list to the user.
As i don't want to use any proxy or pre-built anonymous networks, i choose to drive this searches through the TOR browser.
So, i need to build my tool and let him "drive" the TOR browser to:
- open the TOR browser;
- insert data in Google search box;
- extract the result list and show it to the user;
- refresh the IP address of TOR browser and proceed with the following search.
Do i have to build something in Java and let the tool interfacing with TOR browser?
Is there any other way to control TOR browser, simulating a user who open it, open Google, search the keywords, etc?
Many thanks for your time.
Search for java TOR libraries
For example, consider this library:
Orchid TOR client

Selenium Webdriver vs Jsoup - When to use [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I often have to run test cases on a site I work on. Most of the time I only need to check that an element exists on a site, or I have to scrape a bit of data of the site. Up until now I have been using Jsoup to do this work.
I have recently been introduced to Selenium Webdriver. I have been doing a bit of reading about it but am just trying to figure out when it is best to use it. In cases like mine, checking if an element exists on a page or scraping data I presume I would still be better off using Jsoup? And Selenium would be best suited for filling out forms and clicking buttons on a site?
Selenium has the advantage that it runs an actual browser, it will therefore execute all the JS and so forth in a way that's very, very close to an actual user of the site. The API further allows you to write your tests in a language that's close to the actual interactions (e.g. click to click on a link).
So if you do have tests that have some form of interactions (forms, links, etc.) The overhead of Selenium is worth it. If you simply want to open an URL and check for the existence of some content Jsoup will do.

What is preferable : detecting device using its size or user agent string? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I need to differentiate between mobile/tablet and desktop browsers and i was wondering is it better to parse user agent string or look at width and height of the device to determine same? Which method is preferable and why?
TIA
You typically need to do both. The User Agent isn't enough to distinguish between android phones and tablets.
See this link on how Google Web Toolkit does it:
https://code.google.com/p/google-web-toolkit/source/browse/trunk/samples/mobilewebapp/src/com/google/gwt/sample/mobilewebapp/FormFactor.gwt.xml?r=10041
Basically, you check the useragent for "iphone" or "ipad", else check for "android" (if so, use the size to determine mobile/tablet), otherwise it's a "desktop".
Is this information directly used by your application, or is it used by business/marketing to figure who is looking at your site? If it is a marketing need, then you should use Google Analytics, you simply embed a piece of code into your HTML and your business folks will get ALL the info they'd ever want about visitor's devices, browsing patterns, drop off pages, flows, etc.

Categories