Closed zorroblue closed 8 years ago
@zorroblue
search_location
(or its helper). Can you explain the reason behind your approach ?This seems reasonable when I check it with
for index in range(10,30):
users = search_location("Kharagpur", max_users = index)
print len(users)
Another simple way would be to use a deque and set it maxlen parameter(and break when deque size reaches maxlen). Although I am not sure if its 'better'.
Also instead of int(ceil(num))+1
we could also do int(num)+2
and avoid ceil altogether. Just a thought.
Also instead of int(ceil(num))+1 we could also do int(num)+2 and avoid ceil altogether. Just a thought.
This is a PR for separate issue. Let's discuss it at a more suitable place. :smile:
@Arafatk @kshitij10496 Am pushing my thoughts for ^^ and ^ over to #2 discussion
Here are a few comments on how to modify this PR:
search_location
function for handling this issue.
search_page_users
is true to its purpose of returning "list of all the users on a search result page".If you need help with Git, Stack Overflow is your friend ! If you still can't figure out the procedure, ask on the Gitter Channel.
Ping @zorroblue What's the update on this ?
I am really sorry @kshitij10496 I came home now only. Will work and update you by tomorrow :)
Hey, I saw #1 fixed. Do I git pull the new source and work on it instead?
@zorroblue Thats absolutely fine ! :smile:
Do this on your master
remote
first : git remote -v
upstream
: git remote add upstream https://github.com/kshitij10496/gh-scrapper.git
git fetch upstream git merge upstream/master
(I don't suggest to use git pull
)Checkout this branch : git checkout limitexceed
git rebase master
git push origin limitexceed
.If you face any other problem, comment here or we can discuss it on the Gitter channel.
Why don't you suggest git pull ? I thought it was a one-step solution :) Is there something wrong behind it? I have only used it for small projects, never had problems.
Hey and Btw I am gonna save your comment in my reference.. You have a great future in StackOverflow,my friend! :D
I have 2 primary reasons for advising against the use of git pull
:
git pull
is that it has all kinds of helpful "magic" (like you suggested yourself).
It means that you don’t really get to learn about the branching in git. Mostly things 'Just Work', but when they don’t it’s often difficult to work out why.My first ever PR was messed up due to git pull
. So there's that as well ! :stuck_out_tongue_winking_eye:
@kshitij10496 With regard to the function naming of search_page_users, what you say makes perfect sense. But in that case , why do you pass max_users to the search_page_users function?
But in that case , why do you pass max_users to the search_page_users function?
I don't think that I pass the max_users
argument to search_page_users
.
I am -1 on passing this arg to this functionality.
Yeah you are right. I will look into refactoring it in that way. Sounds better :+1:
Cool ! :+1:
If _search_page_users has to parse the entire page, how do you think we should target the 'partial scraping' of data?
I got a way now :) Ignore ^ My suggestion: Update max_users as I did before..when it falls below 10, trim the users list got from _search_page_users in the _search_location
If _search_page_users has to parse the entire page, how do you think we should target the 'partial scraping' of data?
search_page_users
should scrape data from the entire page.
search_location
need not.
@kshitij10496 Got it!
@kshitij10496 I did the necessary changes. :)
Done!
I complicated things a lot. I realised it only after seeing your simple solution.
I complicated things a lot. I realised it only after seeing your simple solution.
No problem !
I will correct it asap. I don't remember doing anything with the line spaces or indentation. What could have been the reason behind this??
I would suggest you to read about PEP8 coding style guide. Almost all the Python projects I have come across follow this guide.
It would be better if you can install some plugin for checking the coding style automatically for you.
What could have been the reason?
Are you using Sublime Text as your text editor ?
Yes :O
In Sublime Text, the default behaviour when you press Enter in a python module is to auto indent it to 4 spaces(or whatever number you have set. Check your status bar.)
Good work ! This is in. Thanks for your contribution.
@kshitij10496 What's next?
@zorroblue Today I am focussing on developing tests for the functions we have implemented as of now.
Where can I step in? Can I work on feature 2? Wait, let's chat on Gitter instead!
Will research a little more on #2 . This commit fixes #4