I have a link to the online text editor coderpath: https://coderpad.io/MY_ID:
Users with access to the link can type the text there and the text one user types will become visible to all users on the network (similar to Google Docs).
I would like to periodically download the latest text that is typed there using the linux shell, but a simple command
wget "https://coderpad.io/MY_ID" -O text.txt
downloads some HTML file that does not contain the text I typed.
Since my browser displays the text on my screen, I assume that the browser has downloaded it from the web and thus there should be a way to download it again and save it into my own text file. How?
The reason your wget "https://coderpad.io/MY_ID" -O text.txt command does not download the code you typed into the coderpad is because the command is actually downloading a different content depicted in the image below:
Delete the cookies of your current session or type https://coderpad.io/MY_ID into a new browser and you will also see this image rather than the expected code.
Once you enter the requested name into the page and click Go, a few steps later the browser stores new cookies for this webpage. The main cookie related to this question is:
Cookie name | Cokie value example | Explanation
pad_7JJWMNDA_username | Grace Hopper | Name entered into the bar
For the next requests to refresh the page, the browser will send an HTTP request to the website with this cookie embedded. By examining the cookie value, the server will decide to return the expected code rather than the "Enter your name" request.
In theory, adding appropriate cookie values as extra arguments to the wget command should make the server return the expected code. I did not succeed to download the code this way, because of the multiple hidden requests and responses exchanged between the browser and the server. Those hidden requests complicate the whole download procedure.
However, a workaround that works for me is the following:
Download auto HAR extension from https://github.com/Aloisius/autohar. HAR is basically the log of your browser tab activity with content included.
Change max_entries: 100 to max_entries: 1 in all files. This tells to download the HAR after each page refresh (rather than after 100 page refreshes).
Install this modified extension into the Chrome browser.
Open the new tab and open developer tools for that tab by clicking CTRL + SHIFT + I.
Now whenever you refresh the page in this particular tab, HAR file will be downloaded to your ~/Downloads folder.
That HAR file will contain the custom code of interest. You can then use grep
to extract only the code of interest and filter out the rest of the log.
My Windows Phone 8.1 application supports 2 languages and uses own localization system. I found 2 different ways to add the second language:
1) how to add a language in WMAppmanifest file for Windows Phone 8.1 and
2) http://www.jayway.com/2014/04/22/windows-phone-8-1-for-developers-localizing-apps/
I tried both:
1) edit Resources section in Package.appxmanifest
<Resources>
<Resource Language="en-US" />
<Resource Language="ru-RU" />
</Resources>
2) adding Strings folder with subfolders
Strings
en-US
Resources.resw
ru-RU
Resources.resw
but Windows Phone Dashboard doesn't detect any language besides default (en-US)
Have you ensured that the phone you are testing with has both languages installed?
Your app may support more languages, but if you don't set up the phone/keyboard for that language it will just let the user access the language it can.
This tool might help https://dev.windows.com/en-us/develop/multilingual-app-toolkit
Edit: also had to remember to not have empty resource files, need to have some (any) content in them to be found!
I tried to localize my app title using the WP7 AppResLib DLL Generator and it partially work. After installing, the application title in the application list adjust well to the phone's language. For now two languages are supported: Polish and English.
Unfortunately, the application title in the Windows Phone Store is always displayed in English (no matter which language is set as a phone language or which version of the Store's website I visit).
In the root folder of the project I have the following files:
AppResLib.dll
AppResLib.dll.0409.mui (0409 - English (United States))
AppResLib.dll.0415.mui (0415 - Polish (Poland))
And that's how my WMAppManifest.xml file looks like:
<?xml version="1.0" encoding="utf-8"?>
<Deployment xmlns="http://schemas.microsoft.com/windowsphone/2012/deployment" AppPlatformVersion="8.0">
<DefaultLanguage xmlns="" code="en-US" />
<Languages xmlns="">
<Language code="en-US" />
<Language code="pl-PL" />
</Languages>
...
</Deployment>
Can anyone tell me why it doesn't work as expected?
Remark:
Solution provided in the Microsoft's article How to localize an app title for Windows Phone 8 didn't worked for me, since I had problems with compiling the resource project both in VS2012 Express for Windows Phone or VS2013 for Windows.
I would like my application to be associated with certain extension (in my case *.ecw).
The use case is that, when somebody clicks on a link in a browser (f.e. Internet Explorer) that directs to a *.ecw file (http://address.com/files/itscool.ewc), my application is launched and the whole information (nagivation context, file token etc.) is passed along.
*.ecw is a ASCII text file, so it can be viewed in the browser easily but I'd like to invoke my app when such URI/file is entered/launched. I need to process the data stored in the file and produce some output for the user.
So far I have "registered" (according to MSDN tutorial) the file association in the manifest:
<Extensions>
<FileTypeAssociation Name="ECWReader" TaskID="_default" NavUriFragment="fileToken=%s">
<SupportedFileTypes>
<FileType ContentType="application/ecw">.ecw</FileType>
</SupportedFileTypes>
</FileTypeAssociation>
</Extensions>
But this didn't help at all - browser keeps opening those files.
Thanks in advance.
What you did is correct. However, the reason why it doesn't work is that, while the extention of the file is .ewc, the content type that the server responds with when requesting that url is text/html and not application/ecw.
If the server responds with a ContentType text/html, it simply means that the response is intended to be read by a web browser, and not some other app.
Here's a link to a ecw file that comes with a ContentType of text/plain. Change your ContentType filter to match it and try that link in your phone, it should normally work and your app will be invoked.
I would like to add content to my Joomla! site by using an .xml feed that is offered by a company that I am an affiliate of.
The company has an .xml feed available so that affiliates can have the updates done automatically. I thought that I might be able to use the built in newsreader, but the tech support from the company has quickly informed me that an rss feed reader won't do the job. Though it seems to me that an rss feed reader esentially parses .xml?
Has anyone had any experience or advice with having Joomla! display the results of an .xml feed that is not rss?
<?xml version="1.0" encoding="utf-8" ?>
<videos>
<item>
<title>Raja Mahal</title><categories>Movies</categories><genre>Drama, Action & Adventure</genre><description>A Zamindar’s son working as an ordinary mill worker gives shelter to an escaped convict. The convict, however, dupes his benefactor and goes to the Zamindar’s place posing as the heir to the property. <br/><br/></description><vid>52585</vid><keywords>Drama, crime, thriller, stunts, revenge, Krishna, Vijaya Lalitha, Krishnam Raju, Telugu Movies, 70s movies, K.V. Chalam, Jyothi Lakshmi, Rama Kameswara, </keywords><duration>136.10</duration><embed><object width="425" height="355"><param name="movie" value="http://www.rajshritelugu.com/players/affplayer.swf?blogid=A6D70264-037C-453B-8A01-1089F183E5A7_1070&flashpath=http://www.rajshritelugu.com/"></param><embed src="http://www.rajshritelugu.com/players/affplayer.swf?blogid=A6D70264-037C-453B-8A01-1089F183E5A7_1070&flashpath=http://www.rajshritelugu.com/" type="application/x-shockwave-flash" width="425" height="355"></embed></object></embed><thumbnail>http://rajshri-c-18.vo.llnwd.net/d1/content/Telugu/Movies/52585.jpg</thumbnail>
</item>
<item>
<title>Bezawada Bebbuli</title><categories>Movies</categories><genre>Drama, Action & Adventure</genre><description>A righteous lawyer is killed when the thug he wants to expose kills him. One of his sons grows up to become a cop while the younger one becomes a criminal. </description><vid>52579</vid><keywords>Drama, suspense, thriller, revenge, comedy, humour, Krishna, Sri Priya, Radhika, Sivaji Ganesan, Satyanaryana, Sutti Verabhadra Rao, Shyamala Gouri, Sowcar Janaki, Mada, Sakshi Ranga Rao</keywords><duration>112.09</duration><embed><object width="425" height="355"><param name="movie" value="http://www.rajshritelugu.com/players/affplayer.swf?blogid=C53B4659-1E82-4152-82A7-5FBF162BDB66_1070&flashpath=http://www.rajshritelugu.com/"></param><embed src="http://www.rajshritelugu.com/players/affplayer.swf?blogid=C53B4659-1E82-4152-82A7-5FBF162BDB66_1070&flashpath=http://www.rajshritelugu.com/" type="application/x-shockwave-flash" width="425" height="355"></embed></object></embed><thumbnail>http://rajshri-c-18.vo.llnwd.net/d1/content/Telugu/Movies/52579.jpg</thumbnail></item>
</videos>
this is the url from i got this xml file from:
http://www.rajshri.com/syndicate/?uid=1070&sig=b20aee5e1336fb1ffb4f520e67e89a75&lang=telugu&channel=movies
First off, an RSS reader does read XML. However it reads XML files that have a specific structure (RSS). The file source you show above is not in the RSS structure, so an RSS reader would not be able to understand it. A more general XML reader would be able to parse it for you, but you'd need to tell it what to do with the data (it wouldn't inherently know how you want the various elements placed on the page).
Joomla is built on PHP and has the capability to add in extensions and user-created code. Usually this conforms to the Model/Controller/View design principle, but if you create just one PHP page that fetches the XML, parses it with PHP's XML parser, and echoes out the content you want, you can install that into Joomla as a Component and have a menu item point to it, or install it as a Module and have it appear in the sidebar of another page.
If you don't want to deal with the internal workings of Joomla, you could have an outside script on your server (using PHP or another programming language) that captures the XML file from the remote server, parses it with its XML reader, and turns around and outputs the same content in an RSS-structured XML file. Then you could point Joomla's RSS reader at that external script that's acting as an interpreter of the data.
Or if your goal is to allow users to download the file from your website and do something else with it, either put a link in an Article to the file on a remote server, or install an extension like Phoca Download, which would allow your Joomla installation to host the file yourself and track the number of downloads and set security on the file.
Create a folder in your website called "XMLFiles". Create a file in that folder called "Videos.xml" and place your XML in the file.
Pick a programing language (e.g. Perl), pick an XML parsing library (e.g. XML::LibXML), read the data in, extract the bits you want (e.g. with DOM or XPath), then generate some HTML (e.g. with a templating language like TT2).
You could generate static files or use a web framework like CGI::Application or Catalyst.