Giter Club home page Giter Club logo

pythondjango-searchapp's Introduction

Demo

http://kristinottofysearchapp.azurewebsites.net

About

This is a Python/Django application. This application takes input as a query and returns search results from Wikipedia and Twitter.

Author

Program was written by Kristin Ottofy with the help of Visual Studio 2015, and especially Python Tools for Visual Studio!

Getting Twitter Results

The Twitter search is completed through Tweepy. This applications is currently set to use Twitter's REST API which returns a limited amount of results (within a week or so) and does not stream live data. It is set to deliver the most recent results. This application has also capped the amount of results to return from the search. Searching by location looks at the user's public ip address. Any spoofing will cause disfunction :)

Getting Wikipedia Results

The Wikipedia search is completed through Python's Wikipedia Package. Often, queries cause Disambiguation Errors. Currently, those are handled on a limited basis. Ex. if a query like 'banana' returns a DisambiguationError, the error is parsed and the available pages in the error are added to the results. Therefore, this error can happen again on one of those pages, but this application will only add so many results.

Performance Positives

  • Handles no results receieved from either Twitter or Wikipedia by displaying message.
  • If one API is down, the other will still work.
  • Site is responsive and mobile friendly with a Bootstrap collapsable menu.
  • Simple Django setup with templates, forms, views, etc. allows for pretty easy to read code.
  • Twitter Authentication details are not uploaded to GitHub.
  • Uses HTML5 to require an input.

Performance Negatives (TODOs)

  • Asks for twitter authorization at every search. Twitter search is fast but display of results is slow for Twitter and Wikipedia results.
  • layout.html is HTML5 validated. search.html is mostly HTML5 validated except for the href attribute on a element contains "illegal characters".
  • PageSpeed: Server response time is 8.4 seconds - needs to speed up!!

PageSpeed Analyzation

http://kristinottofysearchapp.azurewebsites.net/?query=kristinottofy as of 10/5/15 11:54 am EST

Mobile: 66/100

Should fix:

  • Eliminate render-blocking JavaScript and CSS in above-the-fold content
  • Reduce server response time

Consider fixing:

  • Leverage browser caching
  • Optimize images
  • Minify JavaScript
  • Minify CSS

Passed Rules:

  • Avoid landing page redirects
  • Enable compression
  • Minify HTML
  • Prioritize visible content

User Experience:

Consider Fixing:

  • Size tap targets appropriately

Passed Rules:

  • Avoid app install interstitials that hide contentBETA
  • Avoid plugins
  • Configure the viewport
  • Size content to viewport
  • Use legible font sizes

Desktop: 54/100

Should fix:

  • Reduce server response time

Consider fixing:

  • Eliminate render-blocking JavaScript and CSS in above-the-fold content
  • Leverage browser caching
  • Optimize images
  • Minify JavaScript
  • Minify CSS

Passed Rules:

  • Avoid landing page redirects
  • Enable compression
  • Minify HTML
  • Prioritize visible content

TODO

  1. Part 1: Move Search bar and Submit button to nav-bar.
  2. Part 2: Explore possibility of new home page with search in the middle.
  3. Create option to search twitter by user location. See if it's possible to request IP address, use API to search for IP latitude and longitude, use Tweepy GeoCode.
  4. Redirect to pretty error page when issues are encountered.
  5. Create alert system so admin can know real-time errors. Now using Azure alerts!
  6. Have search.html HTML5 validated.
  7. Figure out how to make Twitter results all the same for a particular query. Now pulls recent updates!
  8. Create DisambiguationError handling function for code readability.
  9. (Optional-speed up server response preferred!) Display "Working on it..." type of message when query is being processed.
  10. Add unit tests for searching twitter by location

pythondjango-searchapp's People

Contributors

kottofy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.