Read site html from a site in a different geo region - geolocation

I am using python and Beautiful soup to read html pages. Unfortunately some sites redirect to my Geo region (AU) so I can't retrieve the target countries version i.e. (UK, US, FR, NZ...)
I have tried using a VPN service but this requires me to manually change the region so I can't automate the process. I have tried using the python quartz.Coregraphics library to click the options on screen but this is temperamental.
Is there a way I can achieve this programmatically?

I have manage to nut this one out myself. Best answered by example for reading a uk based site.
import urllib2
url = 'Some-uk-url'
req = urllib2.Request(url)
req.add_header('Accept-Language', 'en-gb')
req.add_header('X-Forwarded-For', [a uk proxy ipaddress here])
htmltext = urllib2.urlopen(req).read()

Related

How do some sites download YouTube captions?

This is somewhat of a duplicate question of Does YouTube API forbid to download video captions if you are not it's owner?, Get YouTube captions and Does YouTube API forbid to download video captions if you are not it's owner?, which all basically say it's not possible unless to download captions via the YouTube API unless you are the owner or third-party contributions are not enabled; however, my question is how to sites like http://downsub.com/ or http://www.lilsubs.com/ have access to all captions?
In other words, when I access the YouTube API myself (even with youtubepartner and youtube.force-ssl scopes), I can only download the captions of some videos, but when I try the same videos that failed for me with 403: The permissions associated with the request are not sufficient to download the caption track. The request might not be properly authorized, or the video order might not have enabled third-party contributions for this caption. on these other sites, it works fine. I'm assuming they are using the YouTube API to access the captions, but what special sauce are they using? Some special partner key? An different API version? Are they just scraping from the videos themselves or something?
Send a GET request on:
http://video.google.com/timedtext?lang={LANG}&v={VIDEOID}
Example for your video in comment: http://video.google.com/timedtext?lang=ko&v=0db1_qWZjRA
Let's look at another example of yours, i.e. https://www.youtube.com/watch?v=7068mw-6lmI (and I agree about differentiation part in your comment).
There are multiple subtitles available for the video
English
Korean
Spanish
Korean (auto-generated) also called asr (automatic speech recognition)
These stand for the subtitle name parameter (i.e., name=English).
lang stands for the country code.
In your example: https://www.youtube.com/api/timedtext?lang=es-MX&v=7068mw-6lmI&name=Spanish
If subtitle track is available, it is possible to do translation form it, namely using tlang parameter.
https://www.youtube.com/api/timedtext?lang=en&v=7068mw-6lmI&name=English&tlang=lv
https://www.youtube.com/api/timedtext?lang=ko&v=7068mw-6lmI&name=Korean&tlang=lv
This would be my bid for what these sites are using, i.e. translation of the available subtitle track (confirm by trying to use a video without subtitle track as input for one of their sites).
As for asr signature seems to always be needed, but as long as one of the subtitle tracks are available, you could use that for translation. E.g. in your OP comment example:
https://www.youtube.com/api/timedtext?lang=en&v=vx6NCUyg1NE&tlang=lv
Looks like the last example is special with both of subtitle tracks being asr (checked with Chrome -> Inspect -> Network) therefore you need to omit the subtitle name parameter part. This difference unfortunately is not visible in YouTube video's settings wheel.
A 2022 answer:
Option 1: Send a curl request to the webpage: curl -L "https://youtu.be/YbJOTdZBX1g", search for timedtext in the result, and you would get a URL. replace \u0026 with & and you get the link for the subtitle.
Option 2: Use the yt-dlp package:
# For installing see: https://github.com/yt-dlp/yt-dlp#with-pip
from yt_dlp import YoutubeDL
ydl_opts = {
"skip_download": True,
"writesubtitles": True,
"subtitleslangs": ["all", "-live_chat"],
# Looks like formats available are vtt, ttml, srv3, srv2, srv1, json3
"subtitlesformat": "json3",
# You can skip the following option
"sleep_interval_subtitles": 1,
}
with YoutubeDL(ydl_opts) as ydl:
ydl.download(["YbJOTdZBX1g"])
There is this unofficial API used by Youtube :
https://www.youtube.com/api/timedtext?lang={LANG}&v={VIDEO_ID}
LANG here is ISO 639-1 2 letter country code. For your example it would be :
https://www.youtube.com/api/timedtext?lang=ko&v=0db1_qWZjRA
You can check it in network tab while toggling the closed caption button :
I have used youtube-transcript-api successfully to retrieve transcripts. The below is a demo to dump the transcript into HTML with links back to the timestamps in the video:
import sys
from youtube_transcript_api import YouTubeTranscriptApi
video_id = sys.argv[1]
# Retrieve the available transcripts
transcript_list = YouTubeTranscriptApi.list_transcripts(video_id)
# Just use the first transcript, let it raise an exception if none exist.
transcript = next(iter(transcript_list))
print("<html><body>")
for line_map in transcript.fetch():
st_sec = int(line_map['start'] / 60)
st_msec = int(line_map['start'] - st_sec * 60)
tstmp = f"{st_sec}:{st_msec}"
link_to_tstmp = f"https://youtu.be/{video_id}?t={st_sec*60}"
tstmp_str = ("%2d:%-2d" % (st_sec, st_msec)).replace(" ", " ")
#print(f"{st_sec}:{st_msec} {line_map['text']}")
print("""%s %s<br/>""" % (link_to_tstmp, tstmp_str, line_map['text']))
print("</html></body>")
If there are multiple transcripts, the library provides API to search by language etc.
You can further tweak the logic to merge text so you only get one link every so many minutes. I got good results for a lecture by linking at every 1 min and format the lines into a HTML table.

What top-level domains does youtube have?

I am trying to identify youtube link (generally), and I wonder what top-level domains is youtube using?
So far I know about:
.com (youtube.com)
.be (youtu.be)
Are there any others?
PS: for those looking for checking youtube/vimeo video particulary I would recommend to check how to check the valid Youtube url using jquery ...
At the moment, YouTube videos can be accessed by two kinds of link, either the usual URL generated by the UI itself, as you click from one video to the next:
https://www.youtube.com/watch?v=tRgl-78sDX2
Or through a sharing URL, created within the UI by clicking the "share" button:
https://youtu.be/6DzSAaNQHR8
Regarding the second part of your question, what domains are required for access to YouTube? Unfortunately this is a moving target, as the YouTube changes. At the time of writing (Mar 2015), that list is as follows:
*.youtube.com
*.googlevideo.com
*.ytimg.com
In addition to the core domains above, some ancillary domains are also needed to display the ads, etc on most YouTube pages:
apis.google.com
*.googleusercontent.com
*.gstatic.com
The bulk of the traffic itself comes from *.googlevideo.com. Beginning in late 2014, YouTube started progressively enabling SSL on the youtube.com and googlevideo.com domains. You'll need to be aware of this if you're using this information on a filtering or caching device.
Also note this was tested through a browser; native clients (iOS, Android, etc) may operate differently.
I have discovered these Youtube domains so far:
youtube.com // https://www.youtube.com/watch?v=dfGZ8NyGFS8
youtu.be // https://youtu.be/dfGZ8NyGFS8
youtube-nocookie.com // https://www.youtube-nocookie.com/embed/dfGZ8NyGFS8
also youtube.com has a mobile version on subdomain:
m.youtube.com // https://m.youtube.com/watch?v=dfGZ8NyGFS8
I use this list for PHP function parse_url. You may find this question usefull too.
Here are some of the main domains, subdomains and gTLDs related to youtube
1st Level (domains):
.googlevideo.com
.youtu.be
.youtube.com
.youtube.com.br
.youtube.co.nz
.youtube.de
.youtube.es
.youtube.it
.youtube.nl
.youtube-nocookie.com
.youtube.ru
.ytimg.com
2nd Level (subdomains):
.video-stats.l.google.com
.youtube.googleapis.com
.youtubei.googleapis.com
.ytimg.l.google.com
gTLD:
.youtube
gTLD subdomains:
.rewind.youtube
.blog.youtube
Here are all (147) top-level URLs which redirected to youtube.com that I could find (see below for how I got these URLs):
www.youtube.ae https://www.youtube.com/?gl=AE
www.youtube.at https://www.youtube.com/?gl=AT
www.youtube.az https://www.youtube.com/?gl=AZ
www.youtube.ba https://www.youtube.com/?gl=BA
www.youtube.be https://www.youtube.com/?gl=BE
www.youtube.bg https://www.youtube.com/?gl=BG
www.youtube.bh https://www.youtube.com/?gl=BH
www.youtube.bo https://www.youtube.com/?gl=BO
www.youtube.by https://www.youtube.com/?gl=BY
www.youtube.ca https://www.youtube.com/?gl=CA
www.youtube.cat https://www.youtube.com/?gl=ES
www.youtube.ch https://www.youtube.com/?gl=CH
www.youtube.cl https://www.youtube.com/?gl=CL
www.youtube.co https://www.youtube.com/?gl=CO
www.youtube.co.ae https://www.youtube.com/?gl=AE
www.youtube.co.at https://www.youtube.com/?gl=AT
www.youtube.co.cr https://www.youtube.com/?gl=CR
www.youtube.co.hu https://www.youtube.com/?gl=HU
www.youtube.co.id https://www.youtube.com/?gl=ID
www.youtube.co.il https://www.youtube.com/?gl=IL
www.youtube.co.in https://www.youtube.com/?gl=IN
www.youtube.co.jp https://www.youtube.com/?gl=JP
www.youtube.co.ke https://www.youtube.com/?gl=KE
www.youtube.co.kr https://www.youtube.com/?gl=KR
www.youtube.co.ma https://www.youtube.com/?gl=MA
www.youtube.co.nz https://www.youtube.com/?gl=NZ
www.youtube.co.th https://www.youtube.com/?gl=TH
www.youtube.co.tz https://www.youtube.com/?gl=TZ
www.youtube.co.ug https://www.youtube.com/?gl=UG
www.youtube.co.uk https://www.youtube.com/?gl=GB
www.youtube.co.ve https://www.youtube.com/?gl=VE
www.youtube.co.za https://www.youtube.com/?gl=ZA
www.youtube.co.zw https://www.youtube.com/?gl=ZW
www.youtube.com https://www.youtube.com/
www.youtube.com.ar https://www.youtube.com/?gl=AR
www.youtube.com.au https://www.youtube.com/?gl=AU
www.youtube.com.az https://www.youtube.com/?gl=AZ
www.youtube.com.bd https://www.youtube.com/?gl=BD
www.youtube.com.bh https://www.youtube.com/?gl=BH
www.youtube.com.bo https://www.youtube.com/?gl=BO
www.youtube.com.br https://www.youtube.com/?gl=BR
www.youtube.com.by https://www.youtube.com/?gl=BY
www.youtube.com.co https://www.youtube.com/?gl=CO
www.youtube.com.do https://www.youtube.com/?gl=DO
www.youtube.com.ec https://www.youtube.com/?gl=EC
www.youtube.com.ee https://www.youtube.com/?gl=EE
www.youtube.com.eg https://www.youtube.com/?gl=EG
www.youtube.com.es https://www.youtube.com/?gl=ES
www.youtube.com.gh https://www.youtube.com/?gl=GH
www.youtube.com.gr https://www.youtube.com/?gl=GR
www.youtube.com.gt https://www.youtube.com/?gl=GT
www.youtube.com.hk https://www.youtube.com/?gl=HK
www.youtube.com.hn https://www.youtube.com/?gl=HN
www.youtube.com.hr https://www.youtube.com/?gl=HR
www.youtube.com.jm https://www.youtube.com/?gl=JM
www.youtube.com.jo https://www.youtube.com/?gl=JO
www.youtube.com.kw https://www.youtube.com/?gl=KW
www.youtube.com.lb https://www.youtube.com/?gl=LB
www.youtube.com.lv https://www.youtube.com/?gl=LV
www.youtube.com.ly https://www.youtube.com/?gl=LY
www.youtube.com.mk https://www.youtube.com/?gl=MK
www.youtube.com.mt https://www.youtube.com/?gl=MT
www.youtube.com.mx https://www.youtube.com/?gl=MX
www.youtube.com.my https://www.youtube.com/?gl=MY
www.youtube.com.ng https://www.youtube.com/?gl=NG
www.youtube.com.ni https://www.youtube.com/?gl=NI
www.youtube.com.om https://www.youtube.com/?gl=OM
www.youtube.com.pa https://www.youtube.com/?gl=PA
www.youtube.com.pe https://www.youtube.com/?gl=PE
www.youtube.com.ph https://www.youtube.com/?gl=PH
www.youtube.com.pk https://www.youtube.com/?gl=PK
www.youtube.com.pt https://www.youtube.com/?gl=PT
www.youtube.com.py https://www.youtube.com/?gl=PY
www.youtube.com.qa https://www.youtube.com/?gl=QA
www.youtube.com.ro https://www.youtube.com/?gl=RO
www.youtube.com.sa https://www.youtube.com/?gl=SA
www.youtube.com.sg https://www.youtube.com/?gl=SG
www.youtube.com.sv https://www.youtube.com/?gl=SV
www.youtube.com.tn https://www.youtube.com/?gl=TN
www.youtube.com.tr https://www.youtube.com/?gl=TR
www.youtube.com.tw https://www.youtube.com/?gl=TW
www.youtube.com.ua https://www.youtube.com/?gl=UA
www.youtube.com.uy https://www.youtube.com/?gl=UY
www.youtube.com.ve https://www.youtube.com/?gl=VE
www.youtube.cr https://www.youtube.com/?gl=CR
www.youtube.cz https://www.youtube.com/?gl=CZ
www.youtube.de https://www.youtube.com/?gl=DE
www.youtube.dk https://www.youtube.com/?gl=DK
www.youtube.ee https://www.youtube.com/?gl=EE
www.youtube.es https://www.youtube.com/?gl=ES
www.youtube.fi https://www.youtube.com/?gl=FI
www.youtube.fr https://www.youtube.com/?gl=FR
www.youtube.ge https://www.youtube.com/?gl=GE
www.youtube.gr https://www.youtube.com/?gl=GR
www.youtube.gt https://www.youtube.com/?gl=GT
www.youtube.hk https://www.youtube.com/?gl=HK
www.youtube.hr https://www.youtube.com/?gl=HR
www.youtube.hu https://www.youtube.com/?gl=HU
www.youtube.ie https://www.youtube.com/?gl=IE
www.youtube.in https://www.youtube.com/?gl=IN
www.youtube.iq https://www.youtube.com/?gl=IQ
www.youtube.is https://www.youtube.com/?gl=IS
www.youtube.it https://www.youtube.com/?gl=IT
www.youtube.jo https://www.youtube.com/?gl=JO
www.youtube.jp https://www.youtube.com/?gl=JP
www.youtube.kr https://www.youtube.com/?gl=KR
www.youtube.kz https://www.youtube.com/?gl=KZ
www.youtube.lk https://www.youtube.com/?gl=LK
www.youtube.lt https://www.youtube.com/?gl=LT
www.youtube.lu https://www.youtube.com/?gl=LU
www.youtube.lv https://www.youtube.com/?gl=LV
www.youtube.ly https://www.youtube.com/?gl=LY
www.youtube.ma https://www.youtube.com/?gl=MA
www.youtube.me https://www.youtube.com/?gl=ME
www.youtube.mk https://www.youtube.com/?gl=MK
www.youtube.mx https://www.youtube.com/?gl=MX
www.youtube.my https://www.youtube.com/?gl=MY
www.youtube.net.in https://www.youtube.com/
www.youtube.ng https://www.youtube.com/?gl=NG
www.youtube.ni https://www.youtube.com/?gl=NI
www.youtube.nl https://www.youtube.com/?gl=NL
www.youtube.no https://www.youtube.com/?gl=NO
www.youtube.pa https://www.youtube.com/?gl=PA
www.youtube.pe https://www.youtube.com/?gl=PE
www.youtube.ph https://www.youtube.com/?gl=PH
www.youtube.pk https://www.youtube.com/?gl=PK
www.youtube.pl https://www.youtube.com/?gl=PL
www.youtube.pr https://www.youtube.com/?gl=PR
www.youtube.pt https://www.youtube.com/?gl=PT
www.youtube.qa https://www.youtube.com/?gl=QA
www.youtube.ro https://www.youtube.com/?gl=RO
www.youtube.rs https://www.youtube.com/?gl=RS
www.youtube.ru https://www.youtube.com/?gl=RU
www.youtube.sa https://www.youtube.com/?gl=SA
www.youtube.se https://www.youtube.com/?gl=SE
www.youtube.sg https://www.youtube.com/?gl=SG
www.youtube.si https://www.youtube.com/?gl=SI
www.youtube.sk https://www.youtube.com/?gl=SK
www.youtube.sn https://www.youtube.com/?gl=SN
www.youtube.sv https://www.youtube.com/?gl=SV
www.youtube.tn https://www.youtube.com/?gl=TN
www.youtube.tv https://tv.youtube.com/welcome/
www.youtube.ua https://www.youtube.com/?gl=UA
www.youtube.ug https://www.youtube.com/?gl=UG
www.youtube.uy https://www.youtube.com/?gl=UY
www.youtube.vn https://www.youtube.com/?gl=VN
www.youtube.voto https://www.youtube.com/
Here is the first column of the above table (suitable for copying and pasting):
www.youtube.ae
www.youtube.at
www.youtube.az
www.youtube.ba
www.youtube.be
www.youtube.bg
www.youtube.bh
www.youtube.bo
www.youtube.by
www.youtube.ca
www.youtube.cat
www.youtube.ch
www.youtube.cl
www.youtube.co
www.youtube.co.ae
www.youtube.co.at
www.youtube.co.cr
www.youtube.co.hu
www.youtube.co.id
www.youtube.co.il
www.youtube.co.in
www.youtube.co.jp
www.youtube.co.ke
www.youtube.co.kr
www.youtube.co.ma
www.youtube.co.nz
www.youtube.co.th
www.youtube.co.tz
www.youtube.co.ug
www.youtube.co.uk
www.youtube.co.ve
www.youtube.co.za
www.youtube.co.zw
www.youtube.com
www.youtube.com.ar
www.youtube.com.au
www.youtube.com.az
www.youtube.com.bd
www.youtube.com.bh
www.youtube.com.bo
www.youtube.com.br
www.youtube.com.by
www.youtube.com.co
www.youtube.com.do
www.youtube.com.ec
www.youtube.com.ee
www.youtube.com.eg
www.youtube.com.es
www.youtube.com.gh
www.youtube.com.gr
www.youtube.com.gt
www.youtube.com.hk
www.youtube.com.hn
www.youtube.com.hr
www.youtube.com.jm
www.youtube.com.jo
www.youtube.com.kw
www.youtube.com.lb
www.youtube.com.lv
www.youtube.com.ly
www.youtube.com.mk
www.youtube.com.mt
www.youtube.com.mx
www.youtube.com.my
www.youtube.com.ng
www.youtube.com.ni
www.youtube.com.om
www.youtube.com.pa
www.youtube.com.pe
www.youtube.com.ph
www.youtube.com.pk
www.youtube.com.pt
www.youtube.com.py
www.youtube.com.qa
www.youtube.com.ro
www.youtube.com.sa
www.youtube.com.sg
www.youtube.com.sv
www.youtube.com.tn
www.youtube.com.tr
www.youtube.com.tw
www.youtube.com.ua
www.youtube.com.uy
www.youtube.com.ve
www.youtube.cr
www.youtube.cz
www.youtube.de
www.youtube.dk
www.youtube.ee
www.youtube.es
www.youtube.fi
www.youtube.fr
www.youtube.ge
www.youtube.gr
www.youtube.gt
www.youtube.hk
www.youtube.hr
www.youtube.hu
www.youtube.ie
www.youtube.in
www.youtube.iq
www.youtube.is
www.youtube.it
www.youtube.jo
www.youtube.jp
www.youtube.kr
www.youtube.kz
www.youtube.lk
www.youtube.lt
www.youtube.lu
www.youtube.lv
www.youtube.ly
www.youtube.ma
www.youtube.me
www.youtube.mk
www.youtube.mx
www.youtube.my
www.youtube.net.in
www.youtube.ng
www.youtube.ni
www.youtube.nl
www.youtube.no
www.youtube.pa
www.youtube.pe
www.youtube.ph
www.youtube.pk
www.youtube.pl
www.youtube.pr
www.youtube.pt
www.youtube.qa
www.youtube.ro
www.youtube.rs
www.youtube.ru
www.youtube.sa
www.youtube.se
www.youtube.sg
www.youtube.si
www.youtube.sk
www.youtube.sn
www.youtube.sv
www.youtube.tn
www.youtube.tv
www.youtube.ua
www.youtube.ug
www.youtube.uy
www.youtube.vn
www.youtube.voto
There are also the following domains which are not included in the table:
m.youtube.com
m.youtube.<country code>
youtu.be (with and without the trailing dot)
<country code>.youtube.com (e.g. jp.youtube.com)
youtube.com. (with the trailing dot)
youtube.<country code>. (with the trailing dot)
domains like gaming.youtube.com in YouTube's sitemap https://www.youtube.com/sitemaps/sitemap.xml (see linked sub-sitemaps)
For comprehensiveness, I went through Wikipedia's 676 https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes, took all possible two-letter language codes and appended them to the URL as https://www.youtube.com/?gl=<language code>, retrieved the URL, and checked if the source code contained the text "gl":"<language code>". If the language code is not found (e.g. ZZZZZ), the source code will use the default language code of "gl":"CA". Additionally, I went through Mozilla's Public Suffix list https://wiki.mozilla.org/Public_Suffix_List and took all of those and tried every single one.
Here are the following URLs that I couldn't find a corresponding TLD for (it doesn't imply that there should be one, however) which had the TLD code in the URL also in the HTML source:
https://www.youtube.com/?gl=CY
https://www.youtube.com/?gl=LI
https://www.youtube.com/?gl=NP
https://www.youtube.com/?gl=PG
https://www.youtube.com/?gl=YE
Bash script to get URL redirects (sometimes this script doesn't follow the redirect; I am not sure if it is because of my flaky internet, a rate-limit, or because of the script):
while read line; do echo "$line -> "$(curl -Ls -o /dev/null -w %{url_effective} $line); done < youtube_urls.txt;
There's even .youtube, which is quite cool I think.
See https://lifeinaday.youtube/ for example.
If you are trying to catch youtube video links I am using this regexp part I don't know they use national domains for example if you go to youtube.mx they redirect you back to .com with Mexico localizations... I guess they figured out that they cannot host content on some national domains for example if you use domain of Saudi Arabia you have to accept all local laws of Saudi Arabia and if somebody put content that is in violation of their laws owner of website might be in serious legal trouble... so they are using .com for everything and keep content under jurisdiction and laws of US
https?:\/\/ # Either http or https
(?:[\w]+\.)* # Optional subdomains
(?: # Group host alternatives.
youtu\.be/ # Either youtu.be,
| youtube\.com # or youtube.com
| youtube-nocookie\.com # or youtube-nocookie.com
) # End Host Group
By this page http://data.iana.org/TLD/tlds-alpha-by-domain.txt
There is also a .youtube domain itself.
As in the domain https://rewind.youtube
This gave me an idea. Why not use these domains as channel redirects.
eg. My channel (WMTV) will have the domain https://wmtv.youtube
Of course, this would be limited to bigger creators, but as time goes on, this might be a great feature from an individual YouTuber´s marketing standpoint.

QR Code possible data types or standards

I am developing an iOS Application for scanning QR Codes. I am successfully able to scan and get code from QR code.
Question:
My question is what are possible data types and format I can expect from QR Codes?
During my search on google I found QR Code can be used for
Contact data
Calendar data
URL
Email address
Phone number
SMS
Plain text
Geo location
Is this the complete list and is there same standard to represent above data in QR Codes? Means same way of generating QR Code for above QR types.
Is there any standard way of generating and representing data in QR Code?
Basically your text information has to be identifiable for what it is:
There is a very good summary here.
Contact data - use MeCard, or vCard (much more verbose), e.g.: MECARD:Surname, First;ADR:123 Some St., Town, Zip Code, Country;EMAIL:some_name#some_ip.com;TEL:+11800123123;BDAY:19550231;;
Gives:
Calendar data - There are two formats about iCalendar (.ics) & vCalendar (.vcs). These formats can also include location, alarm, to-do items, etc. Note that these are both verbose formats and you may be better off using a short URL to an online file in the file format but the person scanning needs to have internet connectivity and be willing to trust the QR code not to be doing anything bad.
URL: Start your url with the standard format specifier such as http://, e.g.: http://stackoverflow.com/questions/19900835/qr-code-possible-data-types-or-standards
Gives:
Email address - Start with mailto:SomeOne#SomeWhere.org gives:
Phone number - Start with tel: e.g. tel:+1-212-555-1212 gives:
SMS - See the RFC 5724.
Plain text - Just include the text.
Geo location - Use the geo:lat,long,alt format URI: geo:40.71872,-73.98905,100 (100 feet above Googles offices) gives:
WIFI - (ssid is 'abc' and password is '1234'). For WEP encryption: WIFI:S:abc;T:WEP;P:1234;;. For WPA/WPA2: WIFI:S:abc;T:WPA;P:1234;;. Without encryption: WIFI:S:abc;T:nopass;P:1234;;.
All the above example were generated with the Python qrcode package from the command line.
Basically, QR Code returns text data that can be of any type. You can put any type of data in any string format in QR Code. It totally depends on you.
You can consider it as
[NSString stringWithFormat].
Github - Zxing (Barcode Contents) has a summary.
There may or may not be a standard.
If you are looking for non-standard formats,
please update your documentation and contribute to open source.

Not sure if web crawlers read my website correctly

At the W3C Internationalization Checker page, (http://validator.w3.org/i18n-checker/ ) I got no errors about language issues for my website fxrehber.com but when I check my website for web crawlers at a website like http://tools.seobook.com/general/spider-test/ I get the text like these:
SPK Lisansl Forex irketlerinin Kar la t rmalar ve Kullan c Yorumlar
FXrehber com Forex irketleri kar la t rma ve yorumlar Forex'te g venle
i lem yap n T rkiye'de ofisi bulunan
My website is in Turkish, so it should look like this:
SPK Lisanslı Forex şirketlerinin Karşılaştırmaları ve Kullanıcı Yorumları
FXrehber com Forex şirketleri karşılaştırma ve yorumları Forex'te güvenle
işlem yapın Türkiye'de ofisi bulunan
I'm not sure if it's normal behaviour and this is a problem for SEO.
Consider the tools.seobook.com service useless; it apparently cannot even read UTF-8 data correctly (when in document body – it seems to get the meta tag contents OK, making the behavior even more absurd).
If you search for e.g. “SPK Lisanslı Forex şirketlerinin Karşılaştırmaları” in Google, you’ll see your page well placed, with the extract of page content correctly displayed by Google. Ditto when searching with Bing, Yahoo, Yandex.

Need an API to find a full company name given a ticker symbol [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I need a way from within client-side Javascript to find a full company name given a ticker symbol. I am aware of Yahoo Finance's interface at:
http://finance.yahoo.com/d/quotes.csv?s=TKR&f=n
and am able to access that via YQL (since this is cross-domain). However, that doesn't return the full company name, yet Yahoo Finance has such because it appears in their charts for the company and on their pages about the company.
I don't need for the solution to be via Yahoo Finance... just mention it here as I already know about it (and am accessing it for other data).
One of the community-provided YQL tables looks like it will work for you: yahoo.finance.stocks.
Example YQL query:
select CompanyName from yahoo.finance.stocks where symbol="TKR"
Update 2012-02-10: As firebush points out in the comments, this YQL community table (yahoo.finance.stocks) doesn't seem to be working correctly any more, probably because the HTML page structures on finance.yahoo.com have changed. This is a good example of the downside of any YQL tables that rely on HTML scraping rather than a true API. (Which for Yahoo Finance doesn't exist, unfortunately.)
It looks like the community table for Google Finance is still working, so this may be an alternative to try: select * from google.igoogle.stock where stock='TRK';
I have screen scrapped this information in the past either using Yahoo Finance or MSN Money. For instance you can get this information for ExxonMobil by going to (link). As far as an API you might need to build one yourself. For an API checkout Xignite.
You can use the "Company Search" operation in the Company Fundamentals API here: http://www.mergent.com/servius/
You can use Yahoo's look up service using Jonathan Christian's .NET api that is available on NuGet under "Yahoo Stock Quotes".
https://github.com/jchristian/yahoo_stock_quotes
//Create the quote service
var quote_service = new QuoteService();
//Get a quote
var quotes = quote_service.Quote("MSFT", "GOOG").Return(QuoteReturnParameter.Symbol,
QuoteReturnParameter.Name,
QuoteReturnParameter.LatestTradePrice,
QuoteReturnParameter.LatestTradeTime);
//Get info from the quotes
foreach (var quote in quotes)
{
Console.WriteLine("{0} - {1} - {2} - {3}", quote.Symbol, quote.Name, quote.LatestTradePrice, quote.LatestTradeTime);
}
EDIT: After posting this I tried this exact code and it was not working for me so instead I used the Yahoo Finance Managed Api however it's not available via NuGet. A good example of use here
QuotesDownload dl = new QuotesDownload();
DownloadClient<QuotesResult> baseDl = dl;
QuotesDownloadSettings settings = dl.Settings;
settings.IDs = new string[] { "MSFT", "GOOG", "YHOO" };
settings.Properties = new QuoteProperty[] { QuoteProperty.Symbol,
QuoteProperty.Name,
QuoteProperty.LastTradePriceOnly
};
SettingsBase baseSettings = baseDl.Settings;
Response<QuotesResult> resp = baseDl.Download();
Also if you just want to download the stuff stocktwits api has a download link for the symbology and industries under "Resources" http://stocktwits.com/developers/docs
It also possible to use Quandl.com resources. Their WIKI database contains 3339 major stocks and can be fetched via secwiki_tickers.csv file. For a plain file portfolio.lst storing the list of your tickers (stocks in US markets), e.g.:
AAPL
IBM
JNJ
MSFT
TXN
you can scan the .csv file for the name, e.g:
import pandas as pd
df = pd.read_csv('secwiki_tickers.csv')
dp = pd.read_csv('portfolio.lst',names=['pTicker'])
pTickers = dp.pTicker.values # converts into a list
tmpTickers = []
for i in range(len(pTickers)):
test = df[df.Ticker==pTickers[i]]
if not (test.empty):
print("%-10s%s" % (pTickers[i], list(test.Name.values)[0]))
what returns:
AAPL Apple Inc.
IBM International Business Machines Corporation
JNJ Johnson & Johnson
MSFT Microsoft Corporation
TXN Texas Instruments Inc.
It is possible to combine more stocks from other Quandl's resources. See the documentation online.

Resources