I'm trying to get Facebook 'Likes' (http://developers.facebook.com/docs/reference/plugins/like/#) working on my site, but my page titles are dynamic, filled in with bits of .erb.
In initial testing, upon trying to 'send' the page, the .erb bits are coming up blank. I imagine this is because the Rails controller action is not firing each time Facebook goes in just to collect the page title. How can I circumvent this so the dynamic titles work when Facebook comes knocking at the door for a page title?
Related
I've created an app on twitter, and i can make a search and get results.
For example when i searched #starbucks it has found 25.000 tweet but max paging limit
is 100 record per page that means i have to navigate 250 page to insert theese tweets
to my database.
Twitter returns nextpage QueryString its fine so, results like this
tweet
tweet
tweet
...
99.tweet
100.tweet
next page starts from 101 to 199..
i tried meta refresh to navigate automatically, after post form next page link
comes to meta refresh url http://example.com?q=#starbucks&count=100&max_id=xxxxxxxxxxxx/">
and 60 secs after open next page, this process continue until last page.
my question is how can do this on linux with cronjob (vps,vds or hosting)
i can make request for first page, because form working with get request, but
can linux navigate pages automatically?
thank you.
I'm trying to implement a tool using Ruby on Rails, which should crawl a webside and search for hyperlinks. There is a problem: if the website has a huge number of links, the user needs to wait a lot of time.
This is probably a naive question: how can I show results (for example 10 results) and the crawling process still running?
Then, the user click "Next" and it shows the next 10 links, and so on.
Imagine that a page has a list of links.
Implement an action in your controller that, given the a position in the links list, gives the next 10 links and returns a json from the data to be displayed.
With javascript, call the just implemented action with zero, get the json, parse it and display in the screen.
Repeat number 2 adding the number of links as parameter to the ajax call until it receives zero links
This will be way more efficient if you get all links on a page in a call, show it to the user, and then repeat to the user. Like the following:
For a given page, add an action that returns all links it have in json
Do a ajax call to that action, take the links, display, and then use each of the given links as parameter, to crawl to these links.
Do this while you have no more links. Keep a links blacklist to avoid cycles.
If you didn't got the ajax part, check the definition of ajax on wikipedia and this question
So I have a basic (Wordpress powered) portfolio site where most of the content lives on the homepage, and then I'm using a custom posts category for the featured projects, so users can click through and get more info on the project at its category-single.php page. So the idea is it's a pretty flat site in terms of structure.
So flat, in fact, that the site navigation in the header simply links to content that is all on the home page (About, Work, What, Contact are all sections on the home page that get scrolled down to when you click).
What I want to happen is when the user is on the home page, and clicks one of the top nav links, the page scrolls down to that section (no problem here - I've got this part working just fine), and then when the user is on another page of the site (think one level deep, a custom post page) if they click the header nav links it returns them to the homepage and scrolls them down to that section. I'm thinking in terms of basic url anchor structure, like http://somesite.com/page#specific_section where that link takes the user to a specific section on somesite.com/page.
However the trouble I seem to be having is with creating these url's correctly. I've written them as mysite.com#about, mysite.com#work, mysite.com#contact, mysite.com#page-top, but instead of trigging the user to go to the homepage, the browser is interpreting those links as instructions to look for those sections on the current page.
What am I doing wrong, and what is the correct way to accomplish this?
The thing I'm trying to consider additionally, is whether I need to create PHP logic that displays the links one way on the homepage, and another way on the rest of the site.
What you need to do is use the actual filenames of the pages in question, like:
mysite.com/aboutme.html#qualifications
`mysite.com/portfolio.html#ZirTech
For links to the homepage, try either using the root relative path or fully qualifying the link like so:
http://www.mysite.com/#section fully qualified
/#section relative path
You shouldn't need to implement them a different way on the homepage - just implement them properly throughout the site.
When you write the URLs as mysite.com#work, mysite.com#contact, mysite.com#page-top the browser looks for the page in question, because it is not instructed to go to another page (you need to add "/" to redirect it).
If you want them to point to the main page, set them as
mysite.com/index.php#work, mysite.com/index.php#contact, mysite.com/index.php#page-top
Maybe it is possible without index.php, but I'm a bit lazy to test now:
mysite.com/#work, mysite.com/#contact, mysite.com/#page-top
I've installed a Tweet button per Twitter's instructions here: https://dev.twitter.com/docs/tweet-button.
The issue is that if you go to the homepage of my blog, http://trevormckendrick.com you'll notice that the tweet buttons show the number of times the homepage has been shared, not the post.
An example of the behavior I want can be found # http://startupflavor.com. Notice the Tweet button counts are different on every post on the homepage.
I am having that problem that I got some items on a list that needs a like button.
That means I got multiple items on a page. I want to show an unique image and text when a user press like. The problem is that facebook meta tags goes in the header and it is only for the page. That means that the facebook like images are the same for all items. I have read this guide http://hillarsaare.com/multiple-facebook-like-buttons-on-one-page/ how to create multiple facebook likes with unique images and links. But my link that the user likes is a link that is been redirected in my controller to an external URL without any view.
Where should I place the meta tags? Should I create an view for my link ? How should I make an delay on the link that is been redirected?
I made a show file for my link. And but the facebook meta tags in the header, and some javascript to make the redirecet to my external link. In that way I can have multiple like buttons on a page with unique like information and images.