Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switched functionality of down and up arrow keys in QuestionPage #54

Merged
merged 9 commits into from
May 22, 2017
72 changes: 36 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SoCLI [![PyPI version](https://badge.fury.io/py/socli.svg)](https://badge.fury.io/py/socli) [![Build Status](https://travis-ci.org/gautamkrishnar/socli.svg?branch=master)](https://travis-ci.org/gautamkrishnar/socli) [![Collaborizm](https://img.shields.io/badge/Collaborizm-Join%20Project-brightgreen.svg)](https://www.collaborizm.com/project/S1cbUui6)
Stack overflow command line written in python. Using SoCLI you can search and browse stack overflow without leaving the terminal. Just use the **socli** command:
Stack Overflow command line written in python. Using SoCLI you can search and browse Stack Overflow without leaving the terminal. Just use the **socli** command:

![SoCLI in action](https://cloud.githubusercontent.com/assets/8397274/24831468/86c290aa-1cb7-11e7-8161-2665d0c02e4b.gif)

Expand All @@ -11,7 +11,7 @@ Stack overflow command line written in python. Using SoCLI you can search and br
* Mac

##### Requirements
* python 2+
* Python 2.0 or higher

##### For Linux
Install **python** and just use **pip** command to install **socli**:
Expand All @@ -20,13 +20,13 @@ sudo apt-get install python python-pip
sudo pip install socli
```
##### For Windows
[Download and install python](https://www.python.org/downloads/). Dont forget to check the option "Add to path".
[Download and install Python](https://www.python.org/downloads/). Don't forget to check the option "Add to path".

Open a command prompt with administrative privileges and use **pip** command to install **socli**:
```bash
pip install socli
```
Use **easy_install** if your python path have a space in it [Read more:"Failed to create process"](https://github.com/gautamkrishnar/socli/issues/6):
Use **easy_install** if your python path have a space in it. [Read more: "Failed to create process"](https://github.com/gautamkrishnar/socli/issues/6):
```
easy_install socli
```
Expand All @@ -39,38 +39,38 @@ easy_install pip
pip install socli
```
### Updating
Use the command below to update your existing version of **socli** to the newest version, so that you won't miss any features:
Use the command below to update your existing version of **socli** to the newest version so that you won't miss any features:
```bash
sudo pip install --upgrade socli
```

### Usage
##### Quick search
Just use **socli** command followed by the search query:
##### Quick Search
Use the **socli** command followed by the search query:
```bash
socli for loop in python syntax

```

The above command will search for the query "*for loop in python syntax*" and displays the first most voted question in stack overflow with its most voted answer. Pretty quick, right?
The above command will search for the query "*for loop in python syntax*" and displays the first most voted question in Stack Overflow with its most voted answer. Pretty quick, right?

##### Interactive search
You can search the stack overflow interactively by using the command below:
##### Interactive Search
You can search Stack Overflow interactively by using the command below:
```sh
socli -iq html error 404
```

This will display a list of questions from stack overflow for the query "*html error 404*" and it will allow you to choose any of the question you like interactively. When you chose a question, it will display the complete description of the chosed question with its most voted answer. Now you can browse through all the answers of that questions on stack overflow interactively.
This will display a list of questions from Stack Overflow for the query "*html error 404*" and it will allow you to choose any of the questions you like interactively. When you choose a question, it will display the complete description of the chosen question with its most voted answer. You can also browse through the other answers to that question using the up and down arrow keys as well as go back to the list of questions using the left arrow key.

Manual search
This will allow you to choose a question number for example:
##### Manual Search
This will allow you to specify a requested question number for your query. For example, consider the following command:
```sh
socli -r 2 -q javascript porotype function
socli -r 2 -q javascript prototype function
```
Will search for "*javascript porotype function*" in stack overflow and displays the second question that contains it.
This command searches for "*javascript prototype function*" in Stack Overflow and displays the second question that contains it.

##### Topic based search
Stack overflow supports topic by using tags. **socli** allows you to query stack overflow based on specific tags. Just specify the tag via the following command:
##### Topic-Based Search
Stack Overflow supports topic by using tags. **socli** allows you to query Stack Overflow based on specific tags. Just specify the tag via the following command:
```sh
socli -t javascript -q window.open
```
Expand All @@ -80,7 +80,7 @@ socli -t javascript,node.js -q window.open
```
See the complete list of tags [here](https://stackoverflow.com/tags).

##### User Profile browsing
##### User Profile Browsing
Just use the command below to set your [user ID]( https://meta.stackexchange.com/a/111130) in socli. When you execute the command next time, it will automaticially fetch the data.
```sh
socli -u
Expand All @@ -91,8 +91,8 @@ socli --api
```
You can get an API Key [here](https://stackapps.com/apps/oauth/register) by registering as a new app. Please don't use SoCLI as app name.

##### New question
If you can't find an answer for your question in stack overflow, **socli** allows you to creata a new question via the web browswer. Just type the command below and **socli** will open the new question page of stack overflow in the web browser for you:
##### Posting a New Question
If you can't find an answer for your question in Stack Overflow, **socli** allows you to create a new question via the web browser. Just type the command below and **socli** will open the new question page of Stack Overflow in the web browser for you:
```sh
socli -n
```
Expand All @@ -106,23 +106,23 @@ Usage: socli [ Arguments] < Search Query >
###### Arguments (optional)
| Short | Long | Description | Example |
|--------|--------|--------|--------|
| -q | --query | Used to specify the query when arguments are used. A query value must be passed to it. If it is used alone (socli -q query) then it will display the same result as "socli query". | socli -i -q query |
| -i | --interactive | Used to search interactively. It doesnt take any values. It must be followed by a -q or --query after it. | socli -i -q query |
| -r | --res | Used for manual search. It takes the question number as the argument and it must be followed by a -q or --query after it. | socli -r 4 -q query |
| -t | --tag | Specifies the tag to search for the query on stack overflow. It must be followed by a -q or --query after it. | socli -t js -q query |
| -n | --new | Opens the web browser to create a new question on stack overflow. | socli --new |
| -u | --user | Displays the user profile informations. If no argument is given, it will display your profile. | socli -u 22656 |
| -a | --api | Sets a custom API key. | socli -api |
| -d | --del | Deletes the configuration file generated by socli -u manually. | socli -d |
| -h | --help | Displays the help text. | socli --help |
| -q | --query | Used to specify the query when arguments are used. A query value must be passed to it. If it is used alone (socli -q query) then it will display the same result as **socli query**. | **socli -q query** |
| -i | --interactive | Used to search interactively. It doesn't take any values. It must be followed by a -q or --query after it. | **socli -i -q query** |
| -r | --res | Used for manual search. It takes the question number as the argument and it must be followed by a -q or --query after it. | **socli -r 4 -q query** |
| -t | --tag | Specifies the tag to search for the query on Stack Overflow. It must be followed by a -q or --query after it. | **socli -t js -q query** |
| -n | --new | Opens the web browser to create a new question on Stack Overflow. | **socli --new** |
| -u | --user | Displays the user profile informations. If no argument is given, it will display your profile. | **socli -u 22656** |
| -a | --api | Sets a custom API key. | **socli --api** |
| -d | --del | Deletes the configuration file generated by socli -u manually. | **socli -d** |
| -h | --help | Displays the help text. | **socli --help** |

###### Query
It refers to query to search in stack overflow.
This term refers to what you're searching for in Stack Overflow.

### Features
These are the amazing features of **socli**:
These are the amazing features of SoCLI:
* Manual Search
* Interactively browse stack overflow using the interactive mode
* Interactively browse Stack Overflow using the interactive mode
* Coloured interface
* Question stats view
* Tag support
Expand All @@ -132,16 +132,16 @@ These are the amazing features of **socli**:

### To Do
Command line interface for:
- [ ] Stack overflow authentication
- [ ] Posting to stack overflow
- [ ] Stack Overflow authentication
- [ ] Posting to Stack Overflow
- [ ] Upvote answer
- [ ] Comment on an answer
- [ ] Browsing stackoverflow home page

Please check out the list of [issues](https://github.com/gautamkrishnar/socli/issues).

### Contributing
If you are willing to contribute to SoCLI project, You are awesome! Just follow the steps below:
If you are willing to contribute to SoCLI project, you are awesome! Just follow the steps below:

1. Fork it!
2. Make a local clone:
Expand All @@ -166,7 +166,7 @@ Special thanks to these superheroes:
* [nagracks](https://github.com/nagracks) for improving readability of the SoCLI code [#11](https://github.com/gautamkrishnar/socli/pull/11)
* [mwwynne](https://github.com/mwwynne) for adding links to the SoCLI [#13](https://github.com/gautamkrishnar/socli/pull/13)
* [Carlos J. Puga Medina](https://github.com/cpu82) for finding the bug [#11](https://github.com/gautamkrishnar/socli/issues/14) on SoCLI python2 version and for making [SoCLI freshports port](https://www.freshports.org/misc/py-socli/)
* [Jon Ericson](https://github.com/jericson) (*Community Manager, Stack Overflow*) for the PR [#18](https://github.com/gautamkrishnar/socli/pull/18) and letting me know about the Stack overflow attribution policy. Thanks for the [blog post](https://jericson.github.io/2016/08/25/long_tail_docs.html)
* [Jon Ericson](https://github.com/jericson) (*Community Manager, Stack Overflow*) for the PR [#18](https://github.com/gautamkrishnar/socli/pull/18) and letting me know about the Stack Overflow attribution policy. Thanks for the [blog post](https://jericson.github.io/2016/08/25/long_tail_docs.html)
* [Ankit Kr. Singh](https://github.com/kumarankit0411) for fixing some typos PR [#21](https://github.com/gautamkrishnar/socli/pull/21) [#23](https://github.com/gautamkrishnar/socli/pull/23)
* [Harsha Alva](https://github.com/aharshac) for fixing windows encoding problem PR [#24](https://github.com/gautamkrishnar/socli/pull/21)
* [Pia Mancini](https://github.com/piamancini) for adding SoCLI to OpenCollective [#27](https://github.com/gautamkrishnar/socli/pull/27)
Expand Down
Loading