Google URL Shortner using Python requests
This code can convert a url to short url using google URL Shortener API https://developers.google.com/url-shortener/v1/getting_started
- json
- url
- api
- headers
- post
- requests
- short url
This code can convert a url to short url using google URL Shortener API https://developers.google.com/url-shortener/v1/getting_started
1. Create an app and place this in `admin.py`. 2. Add `url(r'^login/$', 'social_auth.views.auth', {'backend': 'google'}, name='login')` to your `urls.py`. 3. Add the app to your `INSTALLED_APPS` after `django.contrib.admin`. 4. Set `USE_SOCIAL_AUTH_AS_ADMIN_LOGIN = True` in your `settings.py`. 5. ... 6. Profit.
This code publishes an iCal file that can be subscribed to in Google Calendar. They change the way they interpret iCal data occasionally, so this may break, I'll try to keep it up to date. There is some crazy string replace stuff going on there, I haven't yet convinced vObject to format things properly. Feedback welcome. *Note: this works for my existing feeds, but if I add a new feed to GCal, the timezones are incorrect, I'm working on that.
example import get_lat loc="jl perjuangan by pass sunyaragi cirebon >>> get_lat(loc) -6.734402 - 108.556878 >>>
This template can be included by other template passing the vars page_url and title: {% with content.get_url as page_url %} {% with content.title as title %} {% include 'share.html' %} {% endwith %} {% endwith %}
Very simple python class for querying Google Geocoder. Accepts a human-readable address, parses JSON results and sets lat and lng. (Full JSON results are stored to `results` property of GoogleLatLng for access to other attributes.) This could easily be expanded to include the XML output option, etc. **Requires PycURL and simplejson.** Example: >>> location = "1600 Amphitheatre Parkway, Mountain View, CA 94043" >>> glatlng = GoogleLatLng() >>> glatlng.requestLatLngJSON(location) >>> print "Latitude: %s, Longitude: %s" % (glatlng.lat, glatlng.lng) Latitude: 37.422782, Longitude: -122.085099` ** Do not forget the usage limits, which include request rate throttling, otherwise, Google might ban you. ** ===
This very simple templatetag can take event objects from django-event-calendar and create the appropriate URLs to automatically allow users to add events from your website to Google calendar.
A function, that converts url into goo.gl link.
Almost copied from snipplet http://djangosnippets.org/snippets/752/, but I used Google Maps API v3
Based on http://code.google.com/p/py-gtranslate/ Removed YAML dependency and list of languages. Instead it use 2-symbol codes for languages.
Google autentication
Sets request.is_crawler Allow bot lockout from certain urls in urlconf ,add view parameter 'deny_crawlers' ex. url(r'^foo/$', 'views.foo',{'deny_crawlers' : True},name='foo') view param is removed after middleware pass.
publish tldrelative rss news exampled web.montao.com.br/li
This is a replacement for Django's built-in ImageField. It uses the Google AppEngine image APIs in order to validate. Notes: 1. Validation of the field counts against your App Engine transformations quota. 2. This code assumes you're only using the in-memory file upload handler. None of the other stock handlers work well on App Engine; you should probably disable them.
A filter to integrate Google Closure compiler in django-compress plugin. 1. [download django-compress](http://code.google.com/p/django-compress/) 2. install it 3. [download Closure Compiler](http://code.google.com/closure/compiler) 4. put the jar at the root of your project 5. put this snippet as a **__init__.py** file in a **google_closure** directory in the filters directory of the plugin 6. add `COMPRESS_JS_FILTERS = ('compress.filters.google_closure.GoogleClosureCompilerFilter',)` to your settings.py You can test `COMPRESS_CLOSURE_JS_ARGUMENTS = {'compilation_level': 'ADVANCED_OPTIMIZATIONS', }` in your settings.py too
31 snippets posted so far.